Home

Awesome

CRON Jobs for meteor

301: This package is moved to the main repository of NPM version, but still can be installed via Atmosphere as Meteor package!

Install:

meteor add ostrio:cron-jobs

Looking for NPM version? - Go to JoSk package

Import:

import { CRONjob } from 'meteor/ostrio:cron-jobs';

Known Issues:

Error: Can't wait without a fiber

Can be easily solved via "bounding to Fiber":

const bound = Meteor.bindEnvironment((callback) => {
  callback();
});

const db   = Collection.rawDatabase();
const cron = new CRONjob({db: db});

const task = (ready) => {
  bound(() => {
    ready();
  });
};

cron.setInterval(task, 60 * 60 * 1000, 'task');