This commit is contained in:
Reasno 2020-01-20 18:07:34 +08:00
parent b92b2b7eb9
commit 45bf51b4bd

View File

@ -50,7 +50,13 @@ return [
// Callback类型定时任务默认
(new Crontab())->setName('Foo')->setRule('* * * * *')->setCallback([App\Task\FooTask::class, 'execute'])->setMemo('这是一个示例的定时任务'),
// Command类型定时任务
(new Crontab())->setType('command')->setName('Bar')->setRule('* * * * *')->setCallback(['command', 'di:init-proxy']),
(new Crontab())->setType('command')->setName('Bar')->setRule('* * * * *')->setCallback([
'command' => 'swiftmailer:spool:send',
// (optional) arguments
'fooArgument' => 'barValue',
// (optional) options
'--message-limit' => 1,
]),
],
];
```