-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Expose an endpoint that returns tasks scheduled to run soon, based on a future time window.
What to implement:
New route: GET /tasks/upcoming
Query params:
window (minutes, default 60)
limit, offset (optional)
Return tasks where:
status = 'pending' & run_at is between NOW() and NOW() + interval 'window minutes'
Order results by run_at ascending.
About the window parameter
window defines how far into the future to look.
Example:
GET /tasks/upcoming?window=30 , This returns pending tasks scheduled in the next 30 minutes.
DB logic:
Select tasks where:
status = 'pending'
run_at is between NOW() and NOW() + interval 'window minutes'
Order by run_at ascending
Expected result
A filtered, chronological array of upcoming tasks.
Empty array if nothing is scheduled in the window.
Reactions are currently unavailable