agendash icon indicating copy to clipboard operation
agendash copied to clipboard

Rescheduled job runs infinitelly

Open alexbeletsky opened this issue 7 years ago • 1 comments

There is a job scheduled, the database record looks like this,

{
    "_id" : ObjectId("5a314abea4c8964c6bb818a7"),
    "name" : "fact-sync-application",
    "type" : "single",
    "data" : null,
    "priority" : 0,
    "nextRunAt" : ISODate("2017-12-14T17:00:00.277Z"),
    "repeatInterval" : "0 17 * * *",
    "repeatTimezone" : null,
    "lastModifiedBy" : null,
    "lockedAt" : null,
    "lastRunAt" : ISODate("2017-12-13T17:00:00.243Z"),
    "lastFinishedAt" : ISODate("2017-12-13T17:06:51.007Z")
}

From UI, I reschedule the job and new instance appear,

{
    "_id" : ObjectId("5a3257a021628330f8b59893"),
    "name" : "fact-sync-application",
    "data" : null,
    "type" : "normal",
    "priority" : 0,
    "nextRunAt" : null,
    "lastModifiedBy" : null,
    "lockedAt" : ISODate("2017-12-14T10:51:16.500Z"),
    "lastRunAt" : ISODate("2017-12-14T10:51:16.507Z")
}

It's a quite long running job, but what I see, once it's completed it immediately started again. What could be an explanation for that?

Also, I'm thinking what's the rationality behind "Reschedule" feature. What I typically want is to "Restart" the job manually from the UI. Looks like Agenda API allows that via .run() method.

Do you think this is something that can be added as a button for UI as well?

alexbeletsky avatar Dec 14 '17 11:12 alexbeletsky

The issue is still actual.

alexbeletsky avatar Aug 29 '18 16:08 alexbeletsky