12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace app\cron;
- use yunwuxin\cron\Task;
- class CleanTask extends Task
- {
- public function configure()
- {
- $this->everyMinute(); //每分钟执行一次
- }
- /**
- * 执行任务
- * @return mixed
- */
- protected function execute()
- {
- try{
- $this->cleantask();
- }catch (\Exception $e){
- trace($e->getMessage());
- }
- }
- //处理已超时的专项保洁任务
- public function cleantask(){
- set_time_limit(0);
- ini_set("memory_limit","1024M");
- (new \app\common\model\CleanTask())->timer_action();
- }
- }
|