pulsecron / pulse

The modern MongoDB-powered job scheduler library for Node.js
https://pulsecron.com
MIT License
111 stars 11 forks source link

remove fallback date for `nextRunAt` #58

Open fermentfan opened 1 month ago

fermentfan commented 1 month ago

This just creates wrong data. Old jobs that have been executed already and will not be executed again appear as jobs that will run at the current date (as their date is null). It should just be null instead like it is written in the persistence layer. No need for a fallback.

Is this behaviour important for some other logic?

code-xhyun commented 1 month ago

@fermentfan As of now, deleting this value may cause side effects. Please post the specific case where deleting this is necessary in the issue, and I will take a look.

fermentfan commented 1 month ago

We simply query jobs like this:

await this.pulse.jobs({ type: 'normal' });

This returns a set of jobs, in which all jobs that originally have a null 'nextRunAt' in mongodb, have the fallback applied.