mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-25 22:01:16 +00:00
code cleanup
This commit is contained in:
@@ -26,30 +26,30 @@ namespace MalwareMultiScan.Shared.Extensions
|
||||
config.WaitTime = TimeSpan.FromSeconds(120);
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Add Hangfire with Redis storage.
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection.</param>
|
||||
/// <param name="configuration">Configuration.</param>
|
||||
/// <param name="queues">Queue names.</param>
|
||||
public static void AddHangfire(this IServiceCollection services,
|
||||
public static void AddHangfire(this IServiceCollection services,
|
||||
IConfiguration configuration, params string[] queues)
|
||||
{
|
||||
if (queues.Length == 0)
|
||||
queues = new[] {"default"};
|
||||
|
||||
services.AddHangfire(options =>
|
||||
|
||||
services.AddHangfire(options =>
|
||||
options.UseRedisStorage(configuration.GetValue<string>("REDIS_ADDRESS")));
|
||||
|
||||
|
||||
services.AddHangfireServer(options =>
|
||||
{
|
||||
options.Queues = queues;
|
||||
|
||||
|
||||
options.ServerTimeout = TimeSpan.FromSeconds(30);
|
||||
options.HeartbeatInterval = TimeSpan.FromSeconds(5);
|
||||
options.ServerCheckInterval = TimeSpan.FromSeconds(15);
|
||||
|
||||
|
||||
var workerCount = configuration.GetValue<int>("WORKER_COUNT");
|
||||
|
||||
if (workerCount > 0)
|
||||
|
Reference in New Issue
Block a user