Schedule runs at every 15 mins but scheduled to run at specific time
santhitvnl opened this issue · 2 comments
Hi,
I followed this library and the codeburst which schedules and runs just fine but I have below issue with it.
When I run my Asp.Net Core Web API
in Windows 10
environments everything works as scheduled whereas the same same Web Api
when I deploy in Windows Server Core
, this schedule runs at every 15 mins.
Should I change any thing in the code?
Here is my options at startup.cs
.
services.AddCronJob<BackUpDBService>(c =>
{ // Currently it is running for every 15 mins in server which is wrong.
c.TimeZoneInfo = TimeZoneInfo.Local;
c.CronExpression = @"0 3 * * *";
});
I have a similar job on server running at early morning every day, and it works. However, from your description, I am not able to determine what's wrong.
Could you add some logging in the ScheduleJob
method? So that you can verify the time of the next_occurrence and the time of delay.
@changhuixu , Thanks for comment. This library is just amazing when we needed to create many schedule jobs.
I just realized that this issue is not related with this library but with some other third party tool that I use in my code. Hence closing this. Thanks you.