Update workers setup

This commit is contained in:
2025-07-10 16:47:13 +07:00
parent d07fc4b1e1
commit c2c181e417
19 changed files with 119 additions and 543 deletions

View File

@@ -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;
}