Files
ZangShiQi/app/job/system/DeleteJob.php
2026-04-04 17:27:12 +08:00

27 lines
449 B
PHP
Executable File

<?php
namespace app\job\system;
use think\facade\Log;
use think\queue\Job;
/**
* 任务删除事件
*/
class DeleteJob
{
public function fire(Job $job, $data)
{
$job->delete();
try {
$file = $data['file'];
@unlink($file);
return true;
} catch (\Exception $e) {
Log::write($e->getMessage());
$job->delete();
}
}
}