From fe120319288649e2141f0c40e44e446111542fbd Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 1 Aug 2021 22:47:58 -0500 Subject: add Shares stuff to DI --- src/slskd/Startup.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/slskd/Startup.cs b/src/slskd/Startup.cs index dcbf0a16..d30d717e 100644 --- a/src/slskd/Startup.cs +++ b/src/slskd/Startup.cs @@ -41,6 +41,7 @@ namespace slskd using slskd.Messaging; using slskd.Peer; using slskd.Search; + using slskd.Shares; using slskd.Transfer; using slskd.Validation; @@ -104,9 +105,11 @@ namespace slskd return true; }); - // add IStateMonitor to DI, to track application state in an observable way. similar to IOptionsMonitor, - // but state is managed by the application itself. Usage is roughly the same. - services.AddSingleton(); + // add IStateMonitor instances to DI, to track application state in an observable way. + // imilar to IOptionsMonitor, but state is managed by the application itself. + // Usage is roughly the same. + services.AddSingleton, StateMonitor>(); + services.AddSingleton, StateMonitor>(); services.AddCors(options => options.AddPolicy("AllowAll", builder => builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader())); @@ -205,9 +208,8 @@ namespace slskd services.AddSingleton(); services.AddSingleton(); services.AddSingleton(_ => new RoomTracker(messageLimit: 250)); - services.AddSingleton(_ => - new SharedFileCache(OptionsAtStartup.Directories.Shared, 3600000)); + services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); services.AddSingleton(); -- cgit v1.2.3