改进 更新方式

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
if ($module->status === 'down') {
$module->update([
'status' => 'up'
]);
$module->status = 'up';
}
$json = $response->json();
@ -91,15 +89,13 @@ public function handle()
// if module return maintenance, then set module status to maintenance
if ($response->status() == 503) {
$module->update([
'status' => 'maintenance'
]);
$module->status = 'maintenance';
} else {
$module->update([
'status' => 'down'
]);
$module->status = 'down';
}
}
$module->save();
}
// if local