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