Skip to content

Set Up pgBoss for Scheduling and Queuing Jobs #147

@theosiemensrhodes

Description

@theosiemensrhodes

Description:

Integrate pgBoss into the backend to enable scheduling and running of both:

  • Predefined jobs (e.g. recurring DB tasks, daily digests)
  • Ad-hoc jobs (e.g. "run this job at X date/time")

This will be the foundation for all time-based or background jobs, i.e. the notification service, and jobs to clean-up orphaned image files/deactivate inactive users.

Requirements:

  • Design first: Decide on:
    • How and where jobs will be registered (e.g. a /jobs folder or config object)
    • How jobs will be scheduled programmatically (e.g. service with schedule(jobName, data, options))
  • Set up pg-boss connection (reuses existing Postgres)
  • Create a generic job runner service/module that:
    • Registers and runs handlers
    • Supports one-off and recurring jobs
    • Uses retry logic where appropriate
  • Add two test jobs:
    • A recurring cleanup job
    • A one-off scheduled test job

Resources:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions