Iterruption of background process on half of cycle

I have a cycle foreach inside my background process i need to repeat every 40 minutes:

The array of switches contains 212 items, and that process must finish in 3 minutes. But when cycle reaches 90 item, it starting again with first. What can be the problem?
Also this is my hangfire defenition in Startup.Auth.cs:

var server = new BackgroundJobServer();
var options = new DashboardOptions { AppPath = VirtualPathUtility.ToAbsolute("/Global.aspx") };
app.UseHangfireDashboard("/hangfire", options);
app.UseHangfireServer(new Controllers.HomeController.BackgroundProcess());

Have you checked the log? It might be restarted because of exception.

1 Like

I have a similar issue (and I am definitely not getting any exceptions). My post

I didn’t even know that there are logs. Thank you.