From 693f9ab3ea451301cf2099c6f244247e0619988f Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Fri, 9 Sep 2022 17:02:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Jobs/Remote/Host.php | 7 ++++++- app/Models/Host.php | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Jobs/Remote/Host.php b/app/Jobs/Remote/Host.php index 5afb897..3477229 100644 --- a/app/Jobs/Remote/Host.php +++ b/app/Jobs/Remote/Host.php @@ -58,10 +58,15 @@ public function handle() case 'delete': $response = $http->delete('hosts/' . $host->id); - if ($response->status() === 404) { + // if successful + if ($response->successful()) { $host->delete(); } + // if ($response->status() === 404) { + // $host->delete(); + // } + return 0; // if response code is 404 // if ($response->successful() || $response->failed()) { diff --git a/app/Models/Host.php b/app/Models/Host.php index f316262..c03d1ca 100644 --- a/app/Models/Host.php +++ b/app/Models/Host.php @@ -2,7 +2,6 @@ namespace App\Models; -use Log; use App\Models\Module\Module; use App\Exceptions\CommonException; use App\Models\WorkOrder\WorkOrder;