Skip to content

Commit

Permalink
limit retries
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed May 14, 2024
1 parent 54cf27e commit dab13e2
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions PoolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,15 @@ private async Task<bool> DeleteRunner(DeleteRunnerTask rt)
_logger.LogError(
$"Unable to delete runner [{rt.ServerId} | Retry: {rt.RetryCount}]: {ex.Message}");
rt.RetryCount += 1;
_queues.DeleteTasks.Enqueue(rt);
if (rt.RetryCount < 10)
{
_queues.DeleteTasks.Enqueue(rt);
}
else
{
_logger.LogError($"Retries exceeded for {rt.ServerId}. Giving up.");
}

return false;
}
}
Expand All @@ -378,7 +386,14 @@ private async Task<bool> CreateRunner(CreateRunnerTask rt)
{
_logger.LogError($"Unable to create runner [{rt.Size} on {rt.Arch} | Retry: {rt.RetryCount}]: {ex.Message}");
rt.RetryCount += 1;
_queues.CreateTasks.Enqueue(rt);
if (rt.RetryCount < 10)
{
_queues.CreateTasks.Enqueue(rt);
}
else
{
_logger.LogError($"Retries exceeded for {rt.Size} on {rt.Arch}. giving up.");
}
return false;
}
}
Expand Down

0 comments on commit dab13e2

Please sign in to comment.