From 1e35ed96464471b7459649722a87d535a0391bf4 Mon Sep 17 00:00:00 2001 From: BrettonYe <867057410@qq.com> Date: Wed, 16 Aug 2023 00:33:26 +0800 Subject: [PATCH] Fixed #280 VNet reload Job type Error --- app/Jobs/VNet/reloadNode.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Jobs/VNet/reloadNode.php b/app/Jobs/VNet/reloadNode.php index 0bfc9d6f..50994df0 100644 --- a/app/Jobs/VNet/reloadNode.php +++ b/app/Jobs/VNet/reloadNode.php @@ -2,6 +2,7 @@ namespace App\Jobs\VNet; +use App\Models\Node; use Arr; use Exception; use Http; @@ -23,9 +24,13 @@ class reloadNode implements ShouldQueue private Collection $nodes; - public function __construct(Collection $nodes) + public function __construct(Collection|Node $nodes) { - $this->nodes = $nodes; + if ($nodes instanceof Collection) { + $this->nodes = $nodes; + } else { + $this->nodes = $nodes->get(); + } } public function handle(): bool