I am building a .net core web application, in the server side I am adding hangfire for scheduled tasks and for long run tasks. in the Startup.cs file I added:
services.AddHangfire(x => x.UseSqlServerStorage(Configuration.GetConnectionString("DefaultConnection")));
and in the configure function I added this:
app.UseHangfireServer();
app.UseHangfireDashboard();
Now the problem is whenever I run the application, a new instance of the server shows up in the dashboard.
is there a way to make sure that only one server is running? or if I can turn off the server when I stop the application (IIS) and start it again when I run the application