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:
Description:
Integrate pgBoss into the backend to enable scheduling and running of both:
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:
/jobsfolder or config object)schedule(jobName, data, options))pg-bossconnection (reuses existing Postgres)Resources: