aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/slskd/Program.cs')
-rw-r--r--src/slskd/Program.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs
index 6392385f..f18d9c09 100644
--- a/src/slskd/Program.cs
+++ b/src/slskd/Program.cs
@@ -60,6 +60,7 @@ namespace slskd
using slskd.Files;
using slskd.Integrations.FTP;
using slskd.Integrations.Pushbullet;
+ using slskd.Integrations.Scripts;
using slskd.Messaging;
using slskd.Relay;
using slskd.Search;
@@ -484,6 +485,10 @@ namespace slskd
var app = builder.Build();
+ // hack: services that exist only to subscribe to the event bus are not referenced by anything else
+ // and are thus never instantiated. force a reference here so they are created.
+ _ = app.Services.GetService<ScriptService>();
+
app.ConfigureAspDotNetPipeline();
if (OptionsAtStartup.Flags.NoStart)
@@ -553,7 +558,6 @@ namespace slskd
services.AddHostedService(p => p.GetRequiredService<IApplication>());
services.AddSingleton<IWaiter, Waiter>();
-
services.AddSingleton<IConnectionWatchdog, ConnectionWatchdog>();
if (OptionsAtStartup.Flags.Volatile)
@@ -578,6 +582,8 @@ namespace slskd
services.AddSingleton<EventService>();
services.AddSingleton<EventBus>();
+ services.AddSingleton<ScriptService>();
+
services.AddSingleton<IBrowseTracker, BrowseTracker>();
services.AddSingleton<IRoomTracker, RoomTracker>(_ => new RoomTracker(messageLimit: 250));