Skip to content

Commit

Permalink
Updater tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 29, 2020
1 parent beb80d3 commit 9b2f31d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Server/API/AgentUpdateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ public async Task<ActionResult> DownloadPackage(string platform, string download
try
{
var startWait = DateTimeOffset.Now;
while (downloadingAgents.Count > AppConfig.MaxConcurrentUpdates)
while (downloadingAgents.Count >= AppConfig.MaxConcurrentUpdates)
{
await Task.Delay(new Random().Next(100, 10000));
}
var waitTime = DateTimeOffset.Now - startWait;

downloadingAgents.Set(downloadId, string.Empty, TimeSpan.FromMinutes(10));

DataService.WriteEvent($"Download started after wait time of {waitTime}. " + "" +
$"Current Downloads: {downloadingAgents.Count}. Max Allowed: {AppConfig.MaxConcurrentUpdates}", EventType.Debug, null);

downloadingAgents.Set(downloadId, string.Empty, TimeSpan.FromMinutes(10));

byte[] fileBytes;
string filePath;

Expand Down

0 comments on commit 9b2f31d

Please sign in to comment.