We have an Azure Scale Out resource, the problem is: For each instance, Hangfire launch a new server, any way to limit to one server only?
Assuming you are using Sql Server storage, which seems to be the case, you can do:
GlobalConfiguration.Configuration.UseSqlServerStorage("YourDB");
var servers = Hangfire.SqlServer.SqlServerStorage.Current
.GetMonitoringApi()
.Servers();
if (servers != null && servers.Count < 1)
//start new server here;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With