改进 忽略项目

This commit is contained in:
iVampireSP.com 2023-01-18 20:11:49 +08:00
parent ab21627a2f
commit 8a727d62f8
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -8,6 +8,7 @@
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Log;
class UpdateOrDeleteHostJob implements ShouldQueue
@ -39,8 +40,10 @@ public function handle(): void
$status = $response->status();
$json = $response->json();
if ($status === 200) {
$host->update($response->json());
$host->update(Arr::except($json, ['id', 'user_id', 'module_id', 'created_at', 'updated_at']));
} else if ($status === 404) {
Log::warning($host->module->name . ' ' . $host->name . ' ' . $host->id . ' 不存在,删除。');
dispatch(new HostJob($host, 'delete'));