改进 忽略项目
This commit is contained in:
parent
ab21627a2f
commit
8a727d62f8
@ -8,6 +8,7 @@
|
|||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class UpdateOrDeleteHostJob implements ShouldQueue
|
class UpdateOrDeleteHostJob implements ShouldQueue
|
||||||
@ -39,8 +40,10 @@ public function handle(): void
|
|||||||
|
|
||||||
$status = $response->status();
|
$status = $response->status();
|
||||||
|
|
||||||
|
$json = $response->json();
|
||||||
|
|
||||||
if ($status === 200) {
|
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) {
|
} else if ($status === 404) {
|
||||||
Log::warning($host->module->name . ' ' . $host->name . ' ' . $host->id . ' 不存在,删除。');
|
Log::warning($host->module->name . ' ' . $host->name . ' ' . $host->id . ' 不存在,删除。');
|
||||||
dispatch(new HostJob($host, 'delete'));
|
dispatch(new HostJob($host, 'delete'));
|
||||||
|
Loading…
Reference in New Issue
Block a user