Skip to content

Commit a853f18

Browse files
committed
Hopefully fix shit
1 parent a74b809 commit a853f18

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

Server/Program.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@
9393
var thread = new Thread(() => ReplayParser.FetchReplays(tokenSource.Token, URLs));
9494
thread.Start();
9595

96-
var token = new CancellationTokenSource();
97-
tokens.Add(token);
98-
var thread2 = new Thread(() => ReplayParser.ConsumeQueue(token.Token));
99-
thread2.Start();
100-
10196
app.Lifetime.ApplicationStopping.Register(() =>
10297
{
10398
foreach (var token in tokens)

Server/ReplayParser.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ public static async Task FetchReplays(CancellationToken token, string[] storageU
162162
var now = DateTime.Now;
163163
var nextRun = now.AddMinutes(10 - now.Minute % 10).AddSeconds(-now.Second);
164164
var delay = nextRun - now;
165+
ConsumeQueue(token);
165166
Log.Information("Next run in " + delay.TotalMinutes + " minutes.");
166167
await Task.Delay(delay, token);
167168
}

0 commit comments

Comments
 (0)