Closed zhujiancc closed 3 years ago
timeout.Timer.NewTimeout(new CronTimerTask(taskName, cron), TimeSpan.FromSeconds(0));
First, for the same cron task, instead of having a new CronTimerTask(taskName, cron)
everytime it is triggered, better to reuse the current one.
Second, TimeSpan.FromSeconds(0)
should be changed to next offset gotten from cron.GetNextOccurrence()
. Note that you may need add some seconds to void cron.GetNextOccurrence()
return the current time
I don't know How to implement CronTimerTask with HashedWheelTimer
here is my code :
The trigger time is not correct , please help me~~