Skip to content

Commit

Permalink
Change node-cron object
Browse files Browse the repository at this point in the history
  • Loading branch information
di3goleite committed Jun 1, 2018
1 parent 8e11483 commit e587c92
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ Raven.config(process.env.SENTRY_DSN).install();
mongoose.connect(process.env.MONGO_URI);

rss.load(path.join(__dirname, process.env.FEEDS_FILE), function() {
const cron = new CronJob('00 59 * * * *', function() {
job.fetchLatestPosts();
}, null, true, 'America/Los_Angeles');
const cron = new CronJob({
cronTime: '0 * * * *',
onTick: function() {
job.fetchLatestPosts();
},
start: true,
timeZone: 'America/Los_Angeles'
});

cron.start();
});
Expand Down

0 comments on commit e587c92

Please sign in to comment.