diff --git a/src/Telegrator.Hosting.Web/TypesExtensions.cs b/src/Telegrator.Hosting.Web/TypesExtensions.cs index 688a343..e5b95d5 100644 --- a/src/Telegrator.Hosting.Web/TypesExtensions.cs +++ b/src/Telegrator.Hosting.Web/TypesExtensions.cs @@ -63,7 +63,10 @@ namespace Telegrator throw new MissingMemberException("Auto configuration disabled, yet no options of type 'TelegratorOptions' wasn't registered. This configuration is runtime required!"); } + CancellationTokenSource globallCancell = new CancellationTokenSource(); + options.GlobalCancellationToken = globallCancell.Token; services.AddSingleton(Options.Create(options)); + services.AddKeyedSingleton("cancell", globallCancell); if (handlers != null) { diff --git a/src/Telegrator.Hosting/TypesExtensions.cs b/src/Telegrator.Hosting/TypesExtensions.cs index bc49f23..5525e6d 100644 --- a/src/Telegrator.Hosting/TypesExtensions.cs +++ b/src/Telegrator.Hosting/TypesExtensions.cs @@ -63,7 +63,10 @@ public static class HostBuilderExtensions throw new MissingMemberException("Auto configuration disabled, yet no options of type 'TelegratorOptions' wasn't registered. This configuration is runtime required!"); } + CancellationTokenSource globallCancell = new CancellationTokenSource(); + options.GlobalCancellationToken = globallCancell.Token; services.AddSingleton(Options.Create(options)); + services.AddKeyedSingleton("cancell", globallCancell); if (handlers != null) {