fix(parsers): detect stale jobs by run age
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 20s
CI/CD Pipeline / Build and Push Images (push) Successful in 6s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
CI/CD Pipeline / Deploy Dev in Dokploy (push) Successful in 1s

This commit is contained in:
2026-04-28 21:56:01 +02:00
parent 0682398935
commit 5857f1a4d2
7 changed files with 90 additions and 37 deletions

View File

@@ -426,7 +426,10 @@ class ParserLoadLogServiceTest(TestCase):
)
old_timestamp = timezone.now() - timedelta(hours=3)
ParserLoadLog.objects.filter(pk=log.pk).update(updated_at=old_timestamp)
BackgroundJob.objects.filter(pk=job.pk).update(updated_at=old_timestamp)
BackgroundJob.objects.filter(pk=job.pk).update(
created_at=old_timestamp,
updated_at=timezone.now(),
)
updated = ParserLoadLogService.mark_stale_in_progress_failed(max_age_minutes=90)