123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- declare(strict_types=1);
- namespace App\Job;
- use App\Master\Framework\Extend\BaseJob;
- use App\Utils\LogUtil;
- class DemoJob extends BaseJob
- {
- //日志板块
- protected string $LOG_MODULE = 'DemoJob';
- /**
- * 任务执行失败后的重试次数,即最大执行次数为 $maxAttempts+1 次
- */
- protected int $maxAttempts = 2;
- public function __construct($params)
- {
- parent::__construct($params);
- }
- /**
- * 执行
- * @param $params
- * @return bool
- */
- protected function do($params): bool
- {
- LogUtil::info('do', $this->LOG_MODULE, __FUNCTION__, '123123213');
- // 业务代码
- return $this->success('执行成功',$params);
- }
- }
|