// +---------------------------------------------------------------------- namespace crmeb\jobs; use app\common\repositories\system\CacheRepository; use app\common\repositories\user\UserRepository; use crmeb\interfaces\JobInterface; use think\facade\Log; class ClearCacheJob implements JobInterface { public function fire($job, $type) { $make = app()->make(CacheRepository::class); try { $make->clearCacheAll($type); } catch (\Exception $e) { Log::INFO('清除缓存失败:'.$type); }; $job->delete(); } public function failed($data) { // TODO: Implement failed() method. } }