改进 计划任务

This commit is contained in:
iVampireSP.com 2023-01-20 19:16:20 +08:00
parent 8198335af6
commit 927377b820
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -41,10 +41,13 @@ public function handle(): void
if ($response['status'] === 200) {
$host->update(Arr::except($response['json'], ['id', 'user_id', 'module_id', 'created_at', 'updated_at']));
} else if ($response['status'] === 404) {
Log::warning($host->module->name . ' ' . $host->name . ' ' . $host->id . ' 不存在,标记为不可用。');
if ($host->status !== 'unavailable') {
Log::warning($host->module->name . ' ' . $host->name . ' ' . $host->id . ' 不存在,标记为不可用。');
$host->status = 'unavailable';
$host->save();
}
// dispatch(new HostJob($host, 'delete'));
$host->status = 'unavailable';
$host->save();
}
}
}