Skip to content

Commit

Permalink
Change download count & change interval
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Feb 21, 2024
1 parent fd9f7b7 commit 5ec7fc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Server/ReplayParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ public static async Task ConsumeQueue(CancellationToken token)
// Consume the queue.
while (Queue.Count > 0)
{
// Since replays are like 200mb long, we want to parrallelize this. 5 at a time.
// Since replays are like 200mb long, we want to parrallelize this.
var tasks = new List<Task>();
for (var i = 0; i < 5; i++)
for (var i = 0; i < 10; i++)
{
if (Queue.Count == 0)
{
Expand Down Expand Up @@ -125,7 +125,7 @@ public static async Task ConsumeQueue(CancellationToken token)
}

/// <summary>
/// Handles fetching replays from the remote storage. This is done on every 10th minute. So 10, 20, 30, 40, 50. 60,
/// Handles fetching replays from the remote storage.
/// </summary>
public static async Task FetchReplays(CancellationToken token, string storageUrl)
{
Expand All @@ -142,7 +142,7 @@ public static async Task FetchReplays(CancellationToken token, string storageUrl
}

var now = DateTime.Now;
var nextRun = now.AddMinutes(30 - now.Minute % 30).AddSeconds(-now.Second);
var nextRun = now.AddMinutes(10 - now.Minute % 10).AddSeconds(-now.Second);
var delay = nextRun - now;
await Task.Delay(delay, token);
}
Expand Down

0 comments on commit 5ec7fc4

Please sign in to comment.