diff --git a/app/Jobs/Support/EMQXKickClientJob.php b/app/Jobs/Support/EMQXKickClientJob.php index ac5240a..1482256 100644 --- a/app/Jobs/Support/EMQXKickClientJob.php +++ b/app/Jobs/Support/EMQXKickClientJob.php @@ -56,20 +56,16 @@ public function handle(): void return; } - if ($clients) { - // 循环翻页 - for ($i = 1; $i <= $clients['meta']['count']; $i++) { - try { - $clients = $emqx->clients([$query => $this->username, 'page' => $i]); - } catch (EmqxSupportException $e) { - Log::error('emqx connect failed.', [$e]); - continue; - } + if ($clients) { + if (count($clients['data']) > 0) { foreach ($clients['data'] as $client) { dispatch(new self($client['clientid'], null)); } + + dispatch(new self(null, $this->username, $this->like_username)); } + } } }