I am adding a job to be executed after 15 mins. I expect this job to be enqueued after 15 minutes so that some worker process can take care of it. I understand that it is hard to say that when an enqueued job will be processed but as per documentation the delayed jobs are enqueued after the defined delay time, which is simply not happening in my case. I am adding a delayed job to be executed after 15 mins but It is showing that job will be enqueued after 12 hours
Below is related data from the table HangFire.State.
CreatedAt : 2014-12-03 10:49:59.770 Data : {“EnqueueAt”:“2014-12-03T22:54:58.6514824Z”,“ScheduledAt”:“2014-12-03T10:49:59.3257412Z”}
Problems:
1. CreatedAt time is not the correct one, I added the job at 2014-12-03 11:49:59.770 which means the database is showing one hour less.
2. Enqueued and Scheduled times are showing values after the 12 hours.
I am not sure why it is happening, but i suspect that since the createdat time is less than the DateTime.Now on the machine HangFire thinks that the execution time has passed so it just reschedules the job to be executed in 12 hours.
It seems that the HangFire is not taking care of the local machine time, instead it is using time from somewhere else!! I hope I am clear enough to explain the problem, I have created some discussion earlier as well but no one replied, perhaps I had not added the enough description. I hope to get some suggestion this time, please ask me if you dont understand my problem completely. I am adding the image which shows the job schedule in the UI
There is a bug in Discouse – you can’t unset a category. Regarding to the Schedule method, it works with UTC, and I don’t wanted to introduce the overload with DateTime parameter, because it is very simple to pass DateTime.Now (instead of DateTime.UtcNow) here and get wrong results.
However, I’ve discovered that the TimeSpan class is not very popular and sometimes confuses people, so it worth to introduce the DateTimeOffset class support that works fine with both DateTimeOffset.Now and DateTimeOffset.UtcNow – https://github.com/HangfireIO/Hangfire/issues/237
I have more problem, after the above fixes there comes a new situation, Job was added to be executed at 1:16 PM and that time has passed a long ago it is now almost 2 hours but the job is still appearing in the scheduled list. Any idea why it has not be processed??
It is very confusing, which versions to use to configure the logger as per the above help article. I am using the Hangfire (.net4) which uses the Common.Logging (2.2.0) which Nlog and Nlog adapters should i use?
We are using the Log4Net and it would be nice if I know which version of Log4Net are compatible. Log4Net adapters are using the Common.Logging > = 2.3 and getting compile error…