w.initFutureJobs(ctx, queue)
// check for new future jobs on an interval
// TODO Make the future jobs check interval configurable in PgBackend
ticker := time.NewTicker(5 * time.Second)
for {
// loop over list of future jobs, scheduling goroutines to wait for jobs that are due within the next 30 seconds
// TODO Make interval of time for which jobs are dedicated a goroutine configurable in PgBackend
for jobID, runAfter := range w.futureJobs {
at := time.Until(runAfter)
if at <= time.Duration(30*time.Second) {
https://github.com/acaloiaro/neoq/blob/a024be6a3953a1512a1accee11bd296e6869c338/postgres_backend.go#L605