When using new worker service
public static IHostBuilder CreateHostBuilder(string args) =>
Host.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
services.AddHangfireServer();
services.AddHangfire(config => config.UseSqlServerStorage(“connectionString”));
services.AddHostedService();
});
-
How do I pass in BackgroundJobServerOptions?
-
How can I queue all my recurring jobs in this setup? I can do it by calling GlobalConfiguration.Configuration.UseSqlServerStorage and RecurringJob.AddOrUpdate but I’d like to avoid calling static methods. Can it be done?