改进 更新方式
This commit is contained in:
parent
efcbb571dc
commit
cc0ac68325
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user