diff --git a/PoolManager.cs b/PoolManager.cs index ca466e8..54741f5 100644 --- a/PoolManager.cs +++ b/PoolManager.cs @@ -354,7 +354,15 @@ private async Task 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; } } @@ -378,7 +386,14 @@ private async Task 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; } }