@@ -90,7 +90,8 @@ public void ConfigureServices(IServiceCollection services)
9090 var action = descriptor . ActionName ;
9191
9292 var pathParameters = descriptor . Parameters
93- . Where ( p => p . BindingInfo is null || p . BindingInfo . BindingSource ? . Id == "Path" )
93+ . Where ( p => p . BindingInfo is null ||
94+ p . BindingInfo . BindingSource ? . Id == "Path" )
9495 . Select ( p => $ "{{{p.Name}}}") ;
9596
9697 var route = string . Join ( "/" , [ controller , action , .. pathParameters ] ) ;
@@ -228,20 +229,25 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerF
228229
229230 if ( ! env . IsDevelopment ( ) )
230231 {
231- app . UseHangfireServer ( new BackgroundJobServerOptions
232+ if ( ! string . IsNullOrEmpty ( Configuration [ "ENABLE_HANGFIRE_SERVER" ] ) &&
233+ Configuration [ "ENABLE_HANGFIRE_SERVER" ] != "false" )
232234 {
233- Queues = new [ ] { "artist_import" } ,
234- ServerName = $ "relistenapi:artist_import ({ Environment . MachineName } )",
235- WorkerCount = 1
236- } ) ;
235+ app . UseHangfireServer ( new BackgroundJobServerOptions
236+ {
237+ Queues = [ "artist_import" ] ,
238+ ServerName = $ "relistenapi:artist_import ({ Environment . MachineName } )",
239+ WorkerCount = 3
240+ } ) ;
237241
238- app . UseHangfireServer ( new BackgroundJobServerOptions
239- {
240- Queues = new [ ] { "default" } , ServerName = $ "relistenapi:default ({ Environment . MachineName } )"
241- } ) ;
242+ app . UseHangfireServer ( new BackgroundJobServerOptions
243+ {
244+ Queues = [ "default" ] ,
245+ ServerName = $ "relistenapi:default ({ Environment . MachineName } )"
246+ } ) ;
247+ }
242248
243249 app . UseHangfireDashboard ( "/relisten-admin/hangfire" ,
244- new DashboardOptions { Authorization = new [ ] { new MyAuthorizationFilter ( ) } } ) ;
250+ new DashboardOptions { Authorization = [ new MyAuthorizationFilter ( ) ] } ) ;
245251 }
246252
247253 app . UseSwagger ( c =>
0 commit comments