-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
wip merge #64
Conversation
@@ -35,12 +37,19 @@ app.use(log()); | |||
|
|||
// init placeholder | |||
console.error( 'loading data' ); | |||
var ph = new Placeholder(); | |||
var ph = new Placeholder({ readonly: true }); |
There was a problem hiding this comment.
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.
25c8348
to
79b6d29
Compare
travis: data download: enable bucket fallback to production
79b6d29
to
610ffd4
Compare
7a3ef77
to
536a979
Compare
536a979
to
4aafb76
Compare
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'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Fixing the Travis tests and splitting up the tests is great! I think there's one minor typo, otherwise it looks good. |
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:
I also added a fix for #60 so that the latest production data is used when a daily archive is not available.
resolves #60