@@ -49,7 +49,7 @@ public static void Execute(IServiceCollection services, IConfiguration configura
49
49
// Add the SentimentSink
50
50
//services.AddSingleton<Fritz.Chatbot.Commands.SentimentSink>();
51
51
52
- services . AddSingleton < IHostedService , FritzBot > ( ) ;
52
+ services . AddHostedService < FritzBot > ( ) ;
53
53
54
54
services . AddSingleton ( new GitHubClient ( new ProductHeaderValue ( "Fritz.StreamTools" ) ) ) ;
55
55
FritzBot . RegisterCommands ( services ) ;
@@ -119,6 +119,7 @@ private static void AddStreamingServices(this IServiceCollection services, IConf
119
119
c => ! bool . TryParse ( c [ "StreamServices:Fake:Enabled" ] , out var enabled ) || ! enabled ) ; // Test to disable
120
120
121
121
services . AddSingleton < StreamService > ( ) ;
122
+
122
123
}
123
124
124
125
/// <summary>
@@ -133,7 +134,7 @@ private static void AddStreamService<TStreamService>(this IServiceCollection ser
133
134
IConfiguration configuration ,
134
135
Func < IConfiguration , ILoggerFactory , TStreamService > factory ,
135
136
Func < IConfiguration , bool > isDisabled )
136
- where TStreamService : class , IStreamService
137
+ where TStreamService : class , IStreamService , IHostedService
137
138
{
138
139
139
140
// Don't configure this service if it is disabled
@@ -174,6 +175,8 @@ private static void AddAspNetFeatures(this IServiceCollection services)
174
175
175
176
} ) . AddMessagePackProtocol ( ) ;
176
177
178
+ services . AddRazorPages ( ) ;
179
+
177
180
services . AddMvc ( )
178
181
. SetCompatibilityVersion ( CompatibilityVersion . Version_3_0 ) ;
179
182
@@ -182,7 +185,9 @@ private static void AddAspNetFeatures(this IServiceCollection services)
182
185
private static void RegisterTwitchPubSub ( this IServiceCollection services ) {
183
186
184
187
services . AddSingleton < Twitch . PubSub . Proxy > ( ) ;
188
+
185
189
services . AddHostedService < TwitchPubSubService > ( ) ;
190
+
186
191
//var provider = services.BuildServiceProvider();
187
192
188
193
//var pubSub = new TwitchPubSubService(
0 commit comments