增加 同步状态
This commit is contained in:
parent
19b3242ef5
commit
45129f95cb
@ -42,7 +42,12 @@ public function handle(): void
|
|||||||
|
|
||||||
$response = $host->module->http()->get('hosts/' . $host->id);
|
$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 . ' 不存在,删除。');
|
Log::warning($host->module->name . ' ' . $host->name . ' ' . $host->id . ' 不存在,删除。');
|
||||||
dispatch(new Module\HostJob($host, 'delete'));
|
dispatch(new Module\HostJob($host, 'delete'));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user