Skip to content

Commit

Permalink
Remove finally which was causing a delay on ALL (even successful) calls
Browse files Browse the repository at this point in the history
  • Loading branch information
paulov-t committed May 20, 2024
1 parent f4757f3 commit 7951e38
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Source/Networking/AkiBackendCommunication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -732,15 +732,13 @@ public async Task<string> PostJsonAsync(string url, string data, int timeout = D
Logger.LogDebug($"Could not perform request to {url}");
Logger.LogDebug($"With Exception: {ex.Message}. {ex.InnerException?.Message}.");
}
finally
{
await Task.Delay(timeout + 1);

if (cts != null && !cts.IsCancellationRequested)
cts.Cancel();
await Task.Delay(timeout + 1);

retry++;
}
if (cts != null && !cts.IsCancellationRequested)
cts.Cancel();

retry++;

} while (retry < maxRetries);

Expand Down

0 comments on commit 7951e38

Please sign in to comment.