改进 扫描全部主机
This commit is contained in:
parent
8b2982f385
commit
6849d551e6
@ -32,8 +32,8 @@ public function __construct()
|
||||
*/
|
||||
public function handle(): void
|
||||
{
|
||||
// 删除所有模块中不存在的主机
|
||||
Host::with('module')->where('created_at', '<', now()->subHour())->chunk(100, function ($hosts) {
|
||||
// 扫描全部主机
|
||||
Host::with('module')->chunk(100, function ($hosts) {
|
||||
foreach ($hosts as $host) {
|
||||
// 忽略维护中的模块
|
||||
if ($host->module->status !== 'up') {
|
||||
@ -41,7 +41,6 @@ public function handle(): void
|
||||
}
|
||||
|
||||
$host->updateOrDelete();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user