改进 主机错误删除

This commit is contained in:
iVampireSP.com 2023-03-04 18:30:12 +08:00
parent f560f03e77
commit 86c0d3db5b
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -52,6 +52,13 @@ public function handle(): void
return;
}
// 如果主机状态为 error 并且上次更新时间超过 7 天,则删除主机
if ($host->status === 'error' && $host->updated_at->lt(now()->subDays(7))) {
$host->delete();
return;
}
$host->load(['module']);
if (! $host->module->isUp()) {