Support the ongoing development of Laravel.io →
Database Queues Jobs
Last updated 1 year ago.
0

Hi I also ran into this and got it working kind of.

Im using Laravel 5.3 and in your job class i have the following code

public function handle( Mailer $mailer )
{
    try {
            if (ToolsService::serverLoadHigh()) {
                $this->release(600);
            } else {
                   .....
            }
        } catch() {
    }
}

Within the trait InteractsWithQueue it has a release() function which schedules the job (in this case) in 10 minutes The value is in seconds.

Only thing if seen is that is still increments the number of attempts. Not sure about reusing the id, I think you can add something to actually reset auto increment value on each run.

Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

LeMike lemike Joined 8 Jan 2017

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.