try switch to db

This commit is contained in:
Flaminel
2025-06-15 00:42:20 +03:00
parent 033b50519b
commit 9e393eebcc
63 changed files with 3245 additions and 2703 deletions

View File

@@ -1,19 +0,0 @@
using Infrastructure.Configuration;
using System.IO;
namespace Executable.DependencyInjection;
public static class ConfigurationDI
{
public static IServiceCollection AddConfiguration(this IServiceCollection services, IConfiguration configuration)
{
// We no longer configure options from appsettings.json
// Instead, we rely solely on JSON configuration files
// Add JSON-based configuration services with Docker-aware path detection
// and automatic caching with real-time change detection
services.AddConfigurationServices();
return services;
}
}

View File

@@ -3,7 +3,6 @@ using Common.Configuration.General;
using Data.Models.Arr;
using Infrastructure.Health;
using Infrastructure.Http;
using Infrastructure.Verticals.DownloadClient.Factory;
using Infrastructure.Verticals.DownloadClient.Deluge;
using Infrastructure.Verticals.DownloadClient.QBittorrent;
using Infrastructure.Verticals.DownloadClient.Transmission;
@@ -22,7 +21,6 @@ public static class MainDI
services
.AddLogging(builder => builder.ClearProviders().AddConsole())
.AddHttpClients(configuration)
.AddConfiguration(configuration)
.AddMemoryCache(options => {
options.ExpirationScanFrequency = TimeSpan.FromMinutes(1);
})
@@ -113,9 +111,6 @@ public static class MainDI
private static IServiceCollection AddDownloadClientServices(this IServiceCollection services) =>
services
// Register the factory that creates download clients
.AddSingleton<IDownloadClientFactory, DownloadClientFactory>()
// Register all download client service types
// The factory will create instances as needed based on the client configuration
.AddTransient<QBitService>()

View File

@@ -26,8 +26,8 @@ public static class ServicesDI
services
.AddSingleton<IEncryptionService, AesEncryptionService>()
.AddTransient<SensitiveDataJsonConverter>()
.AddDbContext<EventsContext>()
.AddDbContext<DataContext>()
.AddTransient<EventsContext>()
.AddTransient<DataContext>()
.AddTransient<EventPublisher>()
.AddHostedService<EventCleanupService>()
// API services