Skip to content
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

How to add multiple jobs #65

Open
niranjans opened this issue Oct 24, 2015 · 2 comments
Open

How to add multiple jobs #65

niranjans opened this issue Oct 24, 2015 · 2 comments

Comments

@niranjans
Copy link

Hi,

I think I'm missing something very simple here. I am trying to run 2 jobs with this package but only the first one is being run and not the second one. Can we not add jobs by just calling SyncedCron.add multiple times? Like so:

SyncedCron.add({
  name: 'Check if 24 hours have elapsed for pending reservations',
  schedule: function(parser) {
    // parser is a later.parse object
    return parser.text('every 15 mins');
  },
  job: function() {
    Meteor.call('checkRes');
  }
});

SyncedCron.add({
  name: 'Routine transaction processing every 12 hours',
  schedule: function(parser) {
    // parser is a later.parse object
    return parser.text('every 12 hours');
  },
  job: function() {
    checkTransaction();

    holdDeposit();

    releaseDeposit();
  }
});

SyncedCron.start();
@zol
Copy link
Member

zol commented Oct 25, 2015

The above looks like it should work. Please provide a repo with a reproduction if you want to take it further.

@scheung38
Copy link

Is it multiple SyncedCron.add or multiple SyncedCron.start?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants