> > I'm adding many jobs into a queue (Pg backend) with something like this: > > https://gist.github.com/scottw/18a95ddaab44837e92526cdbc93d4275#file-inject > > Each job has a delay that increments by 1s. My worker handles the jobs: > > https://gist.github.com/scottw/18a95ddaab44837e92526cdbc93d4275#file-worker > > but the jobs come in bursts every 5 seconds, as you can see in the > timestamps in the output: > > > https://gist.github.com/scottw/18a95ddaab44837e92526cdbc93d4275#file-output-log > > Can anyone recommend a better technique for ensuring jobs don't run before > their timeāand run as close to their time as possible? Am I using 'delay' > wrong? >
This is a tough case. Delays are definitely not meant for 1s accuracy, there will always be delays (haha...i'll see myself out...). I actually find it odd that you have so many jobs that take less than a second to finish, maybe a job queue is not the right tool for the job? Most of my background jobs are more in the 15s-15m range You could also use job dependencies, so later jobs only run when the earlier ones are finished. -- sebastian -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
