mbreit / pg_jobs

Simple ActiveJob queue for PostgreSQL using LISTEN/NOTIFY

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calculate wait timeout for next scheduled job

mbreit opened this issue · comments

Right now, we always wait a fixed number of seconds, if there is no job scheduled now. That means that it may take up to this number of seconds until a scheduled job is picked up. If we calculate the number of seconds until the next scheduled job (and use the configured timeout if it is smaller), then we should be able to run scheduled jobs without a delay.