增加 同步状态

This commit is contained in:
iVampireSP.com 2023-01-13 18:04:25 +08:00
parent 19b3242ef5
commit 45129f95cb
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -42,7 +42,12 @@ public function handle(): void
$response = $host->module->http()->get('hosts/' . $host->id);
if ($response->status() === 404) {
$status = $response->status();
if ($status === 200) {
// 更新主机
$host->update($response->json());
} else if ($status === 404) {
Log::warning($host->module->name . ' ' . $host->name . ' ' . $host->id . ' 不存在,删除。');
dispatch(new Module\HostJob($host, 'delete'));
}