Server abort event

I’m trying to develop my own kind of dashboard for jobs. We use an ASP.Net Core/Angular site that creates the jobs. The jobs are worked on by command line servers. On the ASP.Net side, I’m using a job filter based on the example here: Using Job Filters and I add that in with GlobalJobFilters.Filters.Add. My job filter sends update messages to clients using SignalR.

For the most part, this is working as expected. However, I can’t figure out how to detect when a server goes down. The dashboard that comes with Hangfire shows that the job appears to be aborted when this happens. I was hoping there was a way I could detect this when it happens and update the client.

Ideally there’d be an event I could subscribe to that would fire when a server stops sending heartbeats, but I can’t find anything like that anywhere. It doesn’t seem like anything in the job filter executes when this happens.

The other way I thought about doing this was to write a polling solution. I suspect I’d have to poll IMonitoringApi.ProcessingJobs and use the same logic that the Hangfire dashboard uses to determine if it was aborted. I’d rather not go this route if there’s a better way.

1 Like