I want the user to fill in the cron expression and dynamically add the timing task according to the corn expression submitted by the user. If the corn expression is modified, the timing task is also modified accordingly. If the corn expression is deleted and the timing task is cancelled, Whether nodejs has a corresponding module can achieve this effect
Asked
Active
Viewed 1,555 times
0
-
I am not sure what you are asking but still have a look at one of my answer-https://stackoverflow.com/a/55557032/7849549 – Shubham Dixit Apr 12 '19 at 10:08
-
For example, I have a switch on the page, the user can open and close the scheduled task freely, I want to know how to find the previously opened scheduled task to close when the click is closed. – Calm Apr 12 '19 at 10:27
1 Answers
3
You can use kue-scheduler
module for the same. You would require Redis
for using it.
The timestamp provided by the user can be used to schedule that task in Redis
.
When the timestamp expires, the event would be captured by your application (and you need to write a few lines for it) and execute the corresponding functionality.
You would need to give an identifier to these jobs to identify them in Redis
In case of an update, you can delete the old job and create a new job for the updated timestamp.

Rohit Patial
- 51
- 4