Scheduled task start time

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
Is it possible to change the task behavior adding the opportunity to start task at a given time/day and not only every x seconds/minutes?

Thanks
9 years ago
No, it's not.  But one suggestion I've seen before is to write your scheduled task to have logic to check for the time or the last execution time.  Then schedule that task to run every minute or whatever.  The task is then responsible for executing its action at the appropriate time.
9 years ago
Unfortunately no with out of the box.

You need some modification on source code like bellow

namespace Nop.Services.Tasks
{
...
     public partial class Task
     {
...
            public void Execute(bool throwException = false, bool dispose = true)
            {
                 ...
                     if (scheduleTask.Type == "your task type" && specific date does not match )
                     {
                           return
                      }
                     var task = this.CreateTask(scope);
                 ...
             }
      }
}
9 years ago
Thank you for suggestions.
I know that now it's not possible now. The idea is to make it ready for the next version. I may create the update and share it, if anybody agree with this feature.
Thank you
6 years ago
jhonnywalker wrote:
Thank you for suggestions.
I know that now it's not possible now. The idea is to make it ready for the next version. I may create the update and share it, if anybody agree with this feature.
Thank you

I think this is an important feature. Because at the moment the task duration is controlled by the “Seconds (run period)” field. But if the application is restarted then it runs again. Then the next run is scheduled. This is ok for tasks like the email sender. But for other tasks this might not be suitable as you may need to have some tasks run once per day.

I think there can be a second option like ‘specific time’ along the ‘Seconds (run period)’ option. Same as discount amount option (fixed or percentage).

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