cheatcode / joystick

A full-stack JavaScript framework for building stable, easy-to-maintain apps and websites.
https://cheatcode.co/joystick
Other
209 stars 11 forks source link

Add cleanup script for PostgreSQL based queues to initializeDatabase #325

Closed rglover closed 2 months ago

rglover commented 1 year ago

MongoDB uses a TTL index but PostgreSQL doesn't have this. We need to write a setInterval() that runs a query for completed/failed jobs and then manually diff the completed_at or failed_at value vs. the calculate date based on the passed completedAfterSeconds or failedAfterSeconds setting for the queue.

rglover commented 2 months ago

Done.