Execute Task At A Specific Time

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 3 años
Hi,
i am looking into the schedule task implementation. i find that nop team has implemented it very well.

I would like to run a task at a specific time. e.g. 1 AM everyday.
But, i would not want to configure an out of the box schedule task that keep running every minute to check whether it has reached/past 1 AM to execute.

Has anyone done something similar.
Appreciate any ideas on this. thanks.
Hace 3 años
(Just a guess; I've not looked at the code)
It may be possible to set the task frequency to 24 hours, and then 'seed' the last run date/time to prior 1 am.  (There might be a slight 'drift' so that it won't always occur at exactly 1 am in the future)
Hace 3 años
Hi,
i was thinking something similar to it.
Whenever the 24 hour schedule task kicks off, it will check how much timespan it needs to wait to get to 1 AM. My guess is that it all depends on what time the website was started up.
e.g if the last site restart happened at 2 AM, then the task needs to wait another 23 hours to start execution.
Then, make the task thread sleep.
I am not sure it is a safe approach in terms of threading/locking.

looking at the source code, i think there are other considerations too.
if my task takes 2 hours to complete from 1 AM to 3 AM, then when the scheduler fires at 2 AM, it finds the previous task running and just exit.

thanks.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.