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
schedule function emits with a parameter #320
Comments
This issue has been reported on their repo, see node-cron/node-cron#320
Hi @ImRodry, yep, I've added this to make the date that the task started available inside the task... I don't know if this makes sense anymore... However, there are two PR (#221 and #190) that are adding the received options on scheduling as an extra param to the task function. I think passing the options is a good thing to allows pass some data to the task, and I wonder about adding a What do you think? |
From those two PRs I prefer the implementation in #190 that allows you to choose which args get passed when executing, and I think that PR could just remove |
I too got into problems because of this behavior. Request to kindly remove the |
I installed the package today and I noticed that whenever the schedule function executes the function we pass as an argument, it receives 1 parameter which is a date corresponding to the time at which it was ran. This is not documented and is quite annoying when passing functions to be called, expecting there to be no parameters passed. This isn't in the @types/node-cron package either so I assume it is a bug that I would be happy to PR a fix for, if you'd like.
As a note, this issue is caused by this line:
node-cron/src/task.js
Line 17 in fbc4039
The text was updated successfully, but these errors were encountered: