mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 09:06:38 +00:00
improve retries
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user