Saidqb
Saidqb Hanya sekedar bercerita dengan damai

laravel queue

Summary

run schedule queue job

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // Main queue worker - runs every minute
    $schedule->command('queue:work database --tries=3 --stop-when-empty --max-time=300')
        ->everyMinute()
        ->withoutOverlapping(5)
        ->runInBackground()
        ->appendOutputTo(storage_path('logs/queue-worker.log'));
    
    // High priority queue - runs every 30 seconds
    $schedule->command('queue:work database --queue=high --tries=3 --max-time=300')
        ->everyThirtySeconds()
        ->withoutOverlapping(2)
        ->runInBackground();
    
    // Failed job retries - runs hourly
    $schedule->command('queue:retry all')
        ->hourly();
    
    // Queue health monitoring
    $schedule->command('queue:monitor default,high --max=100')
        ->everyFiveMinutes();
}
Rating:

comments powered by Disqus