From cc0ac6832507695a282e58d640d319e2f1dacdc0 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Wed, 23 Nov 2022 03:20:06 +0000 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Jobs/Module/FetchModule.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/Jobs/Module/FetchModule.php b/app/Jobs/Module/FetchModule.php index 0a692a6..53929f4 100644 --- a/app/Jobs/Module/FetchModule.php +++ b/app/Jobs/Module/FetchModule.php @@ -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