Skip to content

Commit ed0e54a

Browse files
author
Markus Keil
committed
reanable for deletion stage
1 parent d6f23bb commit ed0e54a

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

PoolManager.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,23 @@ private async Task CleanUpRunners(List<GithubTargetConfiguration> targetConfigs)
500500
continue;
501501
}
502502

503-
if (runner.Lifecycle.Any(x => x.Status == RunnerStatus.DeletionQueued))
503+
if (runner.Lifecycle.Count(x => x.Status == RunnerStatus.DeletionQueued) > 10)
504+
{
505+
runner.Lifecycle.Add(new()
506+
{
507+
Status = RunnerStatus.DeletionQueued,
508+
Event = "Still around after going in deletion queue. trying again...",
509+
EventTimeUtc = DateTime.UtcNow
510+
});
511+
await db.SaveChangesAsync();
512+
_queues.DeleteTasks.Enqueue(new()
513+
{
514+
RunnerDbId = runner.RunnerId,
515+
ServerId = htzSrv.Id
516+
});
517+
518+
}
519+
else if (runner.Lifecycle.Any(x => x.Status == RunnerStatus.DeletionQueued))
504520
{
505521
runner.Lifecycle.Add(new()
506522
{

0 commit comments

Comments
 (0)