Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Latest commit

Β 

History

History
42 lines (29 loc) Β· 792 Bytes

README.md

File metadata and controls

42 lines (29 loc) Β· 792 Bytes

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');