1

I have a recurring job, it works perfectly first time, but after the next execution, it gives ERROR. However, there isn't any exception or error in my GetPendingTrips() method. Can some guide me what is the issue here in next attempt of recurring job?

RecurringJob.AddOrUpdate<ITripManager>(nameof(ITripManager), job => job.GetPendingTrips(), Cron.Minutely);

enter image description here

awais
  • 492
  • 4
  • 17

1 Answers1

0

I have realized that Hangfire will not work continuously on background in IIS server, it will immediately stop the recurring job when there isn't any activity on the server. So in order to run the recurring job you need to do the following steps as mentioned in this article.

https://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html

awais
  • 492
  • 4
  • 17