Update workers setup
This commit is contained in:
@@ -49,6 +49,7 @@ public static class WorkersBootstrap
|
||||
{
|
||||
return services
|
||||
.AddApplication()
|
||||
.AddWorkers(configuration)
|
||||
.AddInfrastructure(configuration);
|
||||
}
|
||||
|
||||
@@ -76,6 +77,58 @@ public static class WorkersBootstrap
|
||||
|
||||
private static IServiceCollection AddWorkers(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
// Price Workers
|
||||
if (configuration.GetValue<bool>("WorkerPricesFifteenMinutes", false))
|
||||
{
|
||||
services.AddHostedService<PricesFifteenMinutesWorker>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerPricesOneHour", false))
|
||||
{
|
||||
services.AddHostedService<PricesOneHourWorker>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerPricesFourHours", false))
|
||||
{
|
||||
services.AddHostedService<PricesFourHoursWorker>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerPricesOneDay", false))
|
||||
{
|
||||
services.AddHostedService<PricesOneDayWorker>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerPricesFiveMinutes", false))
|
||||
{
|
||||
services.AddHostedService<PricesFiveMinutesWorker>();
|
||||
}
|
||||
|
||||
// Other Workers
|
||||
if (configuration.GetValue<bool>("WorkerFee", false))
|
||||
{
|
||||
services.AddHostedService<FeeWorker>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerSpotlight", false))
|
||||
{
|
||||
services.AddHostedService<SpotlightWorker>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerTraderWatcher", false))
|
||||
{
|
||||
services.AddHostedService<TraderWatcher>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerLeaderboard", false))
|
||||
{
|
||||
services.AddHostedService<LeaderboardWorker>();
|
||||
}
|
||||
|
||||
if (configuration.GetValue<bool>("WorkerFundingRatesWatcher", false))
|
||||
{
|
||||
services.AddHostedService<FundingRatesWatcher>();
|
||||
}
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user