percolatestudio / meteor-synced-cron

A simple cron system for Meteor. It supports syncronizing jobs between multiple processes.
https://atmospherejs.com/littledata/synced-cron
MIT License
499 stars 110 forks source link

Not running again #113

Closed dominicarrojado closed 8 years ago

dominicarrojado commented 8 years ago

Why does it say not running again? How to debug this?

{"line":"63","file":"synced-cron-server.js","message":"SyncedCron: Scheduled \"Sample name\" next run @Sat Sep 10 2016 03:00:00 GMT+0000 (UTC)","time":{"$date":1473476294724},"level":"info"}
{"line":"63","file":"synced-cron-server.js","message":"SyncedCron: Not running \"Sample name\" again.","time":{"$date":1473476400020},"level":"info"}
SyncedCron.config({
    log: true
});

SyncedCron.add({
    name: 'Sample name',
    schedule: function(parser) {
        return parser.recur().on(0).minute(); // 0th minute of every hour
    },
    job: function() {
       // do the job
    }
});

// Start all cron jobs
SyncedCron.start();
mfeuermann commented 8 years ago

I have answer for your question. You have more than one CRON on One db. Each cron instance writing to same DB. Once of them write NOT RUNNING!

dominicarrojado commented 8 years ago

It's okay now! @mfeuermann

FlawaCLV commented 7 years ago

Sorry, I don't understand @mfeuermann comment. Same error for me. How to solve this issue ?

TheGame2500 commented 7 years ago

@FlawaCLV you're running SyncedCron on more then one server, but all servers connect to the same database. Every time one SyncedCron instance on one server runs a task, it marks it as ran in the cronHistory db collection, and all the other servers running SyncedCron instances will tell you they're not running the task again, because it's already been run.

In short, it's not an issue. It's normal behaviour unless you run your meteor app on only one server.

FlawaCLV commented 7 years ago

@TheGame2500 thanks for your answer. Indeed, I found that yesterday. We're 3 developers running our servers locally but hitting the same MLAB database. We solved it by reconfiguring a little bit are environnement.