Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip merge #64

Merged
merged 8 commits into from
Oct 20, 2017
Merged

wip merge #64

merged 8 commits into from
Oct 20, 2017

Conversation

missinglink
Copy link
Member

@missinglink missinglink commented Oct 17, 2017

in anticipation of a larger refactoring PR, the code in this PR can be merged ahead of the rest in order to make reviews easier:

  • split test suites into 'unit' and 'integration' - this divides the tests which are purely testing js functions from those testing interactions with the database(s).
  • add a script which downloads and extracts wof bundles in one step - for convenience.
  • minor UI performance tweaks to the demo app
  • enable cluster module for muticore http, add cache control headers (enables browser caching).

I also added a fix for #60 so that the latest production data is used when a daily archive is not available.

resolves #60

@ghost ghost assigned missinglink Oct 17, 2017
@ghost ghost added the in review label Oct 17, 2017
@@ -35,12 +37,19 @@ app.use(log());

// init placeholder
console.error( 'loading data' );
var ph = new Placeholder();
var ph = new Placeholder({ readonly: true });
Copy link
Member Author

@missinglink missinglink Oct 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this setting currently does nothing but I left it in because, although it doesn't actually do anything it's valid to create ph as read-only in server mode.

in the subsequent PRs this setting will cause the underlying databases to be opened in read-only mode.

travis: data download: enable bucket fallback to production
@missinglink missinglink force-pushed the wip_merge branch 2 times, most recently from 7a3ef77 to 536a979 Compare October 19, 2017 15:27
server/http.js Outdated
const _ = require('lodash');

// optionally override port using env var
const Placeholder = require('../Placeholder.js');
const logger = require('pelias-logger').get('interpolation');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be placeholder, not interpolation, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, this was introduced in 8d83744, I will add another commit to fix it in this PR

server/http.js Outdated
const logger = require('pelias-logger').get('interpolation');

// select the amount of cpus we will use
const envCpus = parseInt( process.env.CPUS, 10 );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I remember reading somewhere that Node.js defaults to base 10 for parseInt, and I know that as of ES5, the problem with leading zeros causing the number to be interpreted as octal is now gone. Specifying the radix is still best practice on the web, but I wonder if we still need to do it. Any ideas?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mozilla docs are availabe online for you to have a look at.

Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior.

@orangejulius
Copy link
Member

Fixing the Travis tests and splitting up the tests is great! I think there's one minor typo, otherwise it looks good.

@missinglink missinglink merged commit e20d024 into master Oct 20, 2017
@ghost ghost removed the in review label Oct 20, 2017
@orangejulius orangejulius deleted the wip_merge branch May 19, 2018 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI tests can only ever pass on the same day new data is pushed
3 participants