diff options
Diffstat (limited to 'backend/index.js')
| -rw-r--r-- | backend/index.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/index.js b/backend/index.js index 8480f28..3c090f7 100644 --- a/backend/index.js +++ b/backend/index.js @@ -16,9 +16,13 @@ const cleanPayloads = reduce.cleanPayloads(config.reduce); const saveFPayloads = file.saveFPayloads(config.file); function main() { - const start = moment('2018-05-16 16Z'); + const start = moment(config.api.startDate); const end = moment().utc(); const duration = moment.duration(end.diff(start)); + if (start.isAfter(end)) { + console.error(`Start date '${start}' is in the future, exiting.`); + return; + } const later = R.curry((base, hs) => base.clone().add(hs, 'hours')); const hours = R.range(0, Math.floor(duration.asHours())); |
