vsivsi / meteor-job-collection

A persistent and reactive job queue for Meteor, supporting distributed workers that can run anywhere.
https://atmospherejs.com/vsivsi/job-collection
Other
388 stars 68 forks source link

Job 'after' field set at the wrong time #270

Closed tanase-sebastian closed 5 years ago

tanase-sebastian commented 6 years ago

Hello,

I was trying to create jobs using with delay(1000), so that they will run immediatly. However, what happened is that the 'after' field was set to about 41 minutes in the future, instead of 1 second. This happened all of a sudden, while previous job scheduling worked fine; I did not restart meteor nor did I change the system date in between.

What's more, in the logs, the 'Constructed' message is set at the wrong time whereas the 'Job submitted' is set at the correct time.

I attached a screenshot of the Job data in the DB. As you can see the 'created' field is set to '2018-04-13 16:45:32.421' and the 'after' field is set to '2018-04-13 17:27:18.300' when it should have been set to something like '2018-04-13 16:45:34.000'.

job_fields Do you have any pointers on what could have gone wrong ?

For now, I think I will use after() instead of delay() and calculate the date myself.

lh0x00 commented 5 years ago

you can try fixing it this way:

jc.later.date.localTime();
tanase-sebastian commented 5 years ago

Hello,

Thanks for the reply. The issue did not occur again after using delay(), but if it ever comes up again I will try your solution. Thanks.