improve retries

This commit is contained in:
Anton Martynenko
2025-10-29 15:07:20 +01:00
parent 250d13c62e
commit f13f3eea6b
5 changed files with 186 additions and 171 deletions
@@ -106,11 +106,11 @@ public static class RegionTests
Console.WriteLine("Polling for region status updates...");
RegionStatusResponse? finalStatus = null;
int maxAttempts = 30;
int maxAttempts = 120;
for (int i = 0; i < maxAttempts; i++)
{
await Task.Delay(1000);
await Task.Delay(2000);
var statusResponse = await httpClient.GetAsync($"/api/satellite/region/{regionId}");
@@ -127,7 +127,7 @@ public static class RegionTests
throw new Exception("No status returned");
}
Console.WriteLine($" Attempt {i + 1}: Status = {status.Status}");
Console.WriteLine($" Attempt {i + 1}/{maxAttempts}: Status = {status.Status}");
if (status.Status == "completed" || status.Status == "failed")
{
@@ -138,7 +138,7 @@ public static class RegionTests
if (finalStatus == null)
{
throw new Exception("Region processing did not complete in time");
throw new Exception($"Region processing did not complete in time (waited {maxAttempts * 2} seconds)");
}
Console.WriteLine();