@@ -40,7 +40,7 @@ internal static PluginContext Context {
40
40
}
41
41
42
42
// ReSharper disable once InconsistentNaming
43
- private static readonly AsyncLocal < PluginContext > _context = new ( ) ;
43
+ private static readonly ThreadLocal < PluginContext > _context = new ( ) ;
44
44
private static CancellationToken CancellationToken => Context . CancellationToken ;
45
45
46
46
public string Name => StaticName ;
@@ -107,7 +107,7 @@ public async Task OnASFInit(IReadOnlyDictionary<string, JsonElement>? additional
107
107
108
108
public Task OnUpdateProceeding ( Version currentVersion , Version newVersion ) => Task . CompletedTask ;
109
109
110
- public async void CollectGamesOnClock ( object ? source ) {
110
+ public void CollectGamesOnClock ( object ? source ) {
111
111
CollectIntervalManager . RandomlyChangeCollectInterval ( source ) ;
112
112
113
113
if ( ! Context . Valid || ( ( Bots . Count > 0 ) && ( Context . Bots . Count != Bots . Count ) ) ) {
@@ -141,7 +141,9 @@ public async void CollectGamesOnClock(object? source) {
141
141
142
142
if ( ! cts . IsCancellationRequested ) {
143
143
string cmd = $ "FREEGAMES { FreeGamesCommand . CollectInternalCommandString } " + string . Join ( ' ' , reorderedBots . Select ( static bot => bot . BotName ) ) ;
144
- await OnBotCommand ( null ! , EAccess . None , cmd , cmd . Split ( ) ) . ConfigureAwait ( false ) ;
144
+ #pragma warning disable CS1998
145
+ OnBotCommand ( null ! , EAccess . None , cmd , cmd . Split ( ) ) . GetAwaiter ( ) . GetResult ( ) ; // TODO use async
146
+ #pragma warning restore CS1998
145
147
}
146
148
}
147
149
}
0 commit comments