Long Delays & Pauses
Setting Up
<?php
// Add to Console/Kernel.php
$schedule->command('haystacks:resume')->everyMinute();
// One server if you are running the scheduler on multiple servers
$schedule->command('haystacks:resume')->everyMinute()->onOneServer();Long Releasing
<?php
namespace App\Jobs;
use Sammyjo20\LaravelHaystack\Contracts\StackableJob;
use Sammyjo20\LaravelHaystack\Concerns\Stackable;
class ProcessPodcast implements ShouldQueue, StackableJob
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Stackable
public function handle()
{
// Your application code...
$this->longRelease(300); // Release for 5 minutes
// Or use Carbon
$this->longRelease(now()->addDays(2)); // Release for 2 days.
}Pausing the next job
Last updated