1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\cron;
- use app\common\model\GreenTask;
- use yunwuxin\cron\Task;
- //处理已超时绿化养护任务,并从任务栏删除
- class GreenTimeout extends Task
- {
- public function configure()
- {
- $this->everyMinute(); //每分钟执行一次
- }
- /**
- * 执行任务
- * @return mixed
- */
- protected function execute()
- {
- try{
- (new GreenTask())->timer_action();
- }catch (\Exception $e){
- trace($e->getMessage());
- }
- }
- }
|