Skip to content

Build Background Job Queue with Bull and Redis #83

Description

@Mkalbani

Description

Set up a robust background job processing system using Bull and Redis to handle all async work across the API — email delivery, streak evaluation, leaderboard recalculation, NFT minting retries, and calibration jobs. Centralising async work in a job queue prevents request timeouts, enables retries, and gives visibility into processing status.

Acceptance Criteria

  • Bull is configured with Redis as the backend via environment-based config
  • Separate named queues exist for: email, nft, leaderboard, calibration, streaks
  • Each queue has a dedicated processor file under src/jobs/
  • Failed jobs are retried up to 3 times with exponential backoff before being moved to a dead-letter state
  • GET /admin/jobs/status returns queue depths and failed job counts per queue
  • POST /admin/jobs/:queue/retry-failed re-enqueues all dead-letter jobs for a given queue
  • Job processing is gracefully shut down on application termination (drain in-progress jobs)
  • Unit tests cover job enqueue, processor execution, retry logic, and drain behaviour

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions