Skip to content

Commit c33b622

Browse files
disarm github check on stuck jobs
1 parent 47e8179 commit c33b622

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

PoolManager.cs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,17 +294,28 @@ private async Task CheckForStuckJobs(List<GithubTargetConfiguration> targetConfi
294294
};
295295
if (ghJob == null || ghJob.Status != "queued")
296296
{
297-
_logger.LogWarning($"job info for {stuckJob.JobId} not found or job not queued anymore.");
297+
_logger.LogWarning($"job info for {stuckJob.JobId} not found or job not queued anymore on github.");
298298

299+
if (ghJob == null)
300+
{
301+
_logger.LogWarning($"GHjob for {stuckJob.JobId} is null");
302+
}
303+
else if (ghJob.Status != "queued")
304+
{
305+
_logger.LogWarning($"GHjob status for {stuckJob.JobId} is {ghJob.Status}");
306+
}
307+
308+
309+
299310
if (stuckJob.QueueTime + TimeSpan.FromHours(2) > DateTime.UtcNow)
300311
{
301-
_logger.LogWarning($"Marking stuck job {stuckJob.GithubJobId} vanished as it's no longer in the GitHub queued state for more than 2h.");
302-
stuckJob.State = JobState.Vanished;
312+
_logger.LogWarning($"Would mark stuck job {stuckJob.GithubJobId} vanished as it's no longer in the GitHub queued state for more than 2h.");
313+
/*stuckJob.State = JobState.Vanished;
303314
stuckJob.CompleteTime = DateTime.UtcNow;
304-
await db.SaveChangesAsync();
315+
await db.SaveChangesAsync();*/
305316
}
306317

307-
continue;
318+
//continue;
308319
}
309320

310321
string runnerToken = owner.Target switch

0 commit comments

Comments
 (0)