Each of our hangfire server nodes has an in-memory cache, which we want to fill every few minutes with data from an external service.
This is not a “shared” cache, each server node has it’s own cache.
Is it possible to set up a recurring job which will run on each server?
I would not put this on Hangfire. I would have a process outside of Hangfire but within the service itself that builds/refreshes the cache.
Yes, thanks, we came to the same conclusion, and decided to use an IHostedService / BackgroundService
BackgroundService Class (Microsoft.Extensions.Hosting) | Microsoft Learn