Skip to content

#250 Add support for task retry logic#280

Merged
MaryammAli merged 4 commits into
BlockDash-Studios:mainfrom
OmniZlatoon:retry-logic
Jun 30, 2026
Merged

#250 Add support for task retry logic#280
MaryammAli merged 4 commits into
BlockDash-Studios:mainfrom
OmniZlatoon:retry-logic

Conversation

@OmniZlatoon

Copy link
Copy Markdown
Contributor

Grading jobs retry system

This module provides a DB-backed retry mechanism for failed grading jobs.

How it works

  • A grading_jobs table stores failed job payloads and metadata (attempts, nextRetryAt, etc.).
  • GradingJobService polls the table periodically and replays jobs by calling GradingResultService.saveResult.
  • Exponential backoff is used between attempts. After maxAttempts the job is marked FAILED.

Configuration & running

  • No external dependencies (Redis) required — the system uses the primary database (TypeORM).
  • The module is auto-registered in AppModule and will start polling when the application boots.

Usage

  • To enqueue a failed grading job from other code, inject GradingJobService and call enqueueFailedJob(submissionId, payload, maxAttempts?).

Testing

  • The service exposes processOnce() for tests to trigger a single retry pass.

Notes

  • Ensure autoLoadEntities or explicit entity registration is enabled so TypeORM picks up GradingJobEntity.
  • Consider adding retention/cleanup for old failed jobs and hooks for alerting on repeated failures.

closes #250

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@OmniZlatoon Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@OmniZlatoon

Copy link
Copy Markdown
Contributor Author

Greetings maintainer, I have completed the task assigned to me on drips. please review the PR

@MaryammAli MaryammAli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MaryammAli MaryammAli merged commit 2641abf into BlockDash-Studios:main Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for task retry logic

2 participants