Skip to content

Commit

Permalink
better cleanup of htz vms
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticroentgen committed Aug 6, 2024
1 parent 3ead432 commit 2767b82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PoolManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ private async Task CleanUpRunners(List<GithubTargetConfiguration> targetConfigs)
await db.SaveChangesAsync();

}
else if (runner.LastState >= RunnerStatus.Provisioned && DateTime.UtcNow - runner.LastStateTime > TimeSpan.FromMinutes(5))
else if ((runner.LastState >= RunnerStatus.Provisioned && DateTime.UtcNow - runner.LastStateTime > TimeSpan.FromMinutes(5)) ||
(DateTime.UtcNow - runner.LastStateTime > TimeSpan.FromMinutes(30)))
{
_logger.LogInformation($"Removing VM that is not in any GitHub registration: {htzSrv.Name} created at {htzSrv.Created:u}");
runner.IsOnline = false;
Expand Down

0 comments on commit 2767b82

Please sign in to comment.