改进 更新方式

This commit is contained in:
iVampireSP.com 2022-11-23 03:20:06 +00:00
parent efcbb571dc
commit cc0ac68325

View File

@ -62,9 +62,7 @@ public function handle()
// 如果模块状态为 down则更新为 up // 如果模块状态为 down则更新为 up
if ($module->status === 'down') { if ($module->status === 'down') {
$module->update([ $module->status = 'up';
'status' => 'up'
]);
} }
$json = $response->json(); $json = $response->json();
@ -91,15 +89,13 @@ public function handle()
// if module return maintenance, then set module status to maintenance // if module return maintenance, then set module status to maintenance
if ($response->status() == 503) { if ($response->status() == 503) {
$module->update([ $module->status = 'maintenance';
'status' => 'maintenance'
]);
} else { } else {
$module->update([ $module->status = 'down';
'status' => 'down'
]);
} }
} }
$module->save();
} }
// if local // if local