Chain commands in Laravel Artisan Scheduler?

前端 未结 1 1771
我寻月下人不归
我寻月下人不归 2021-01-04 04:43

Suppose I have three commands I want to schedule: \'commandA\', \'commandB\', and \'commandC\'

But I don\'t want to run \'commandB\' until \'commandA\' is complete a

相关标签:
1条回答
  • 2021-01-04 05:04

    Use then(Closure $callback) to chain commands:

    $schedule->command('commandA')->everyFiveMinutes()->then(function() {
        $this->call('commandB');
        $this->call('commandC');
    });
    
    0 讨论(0)
提交回复
热议问题