diff --git a/app/Initialize/InitializeMembers.php b/app/Initialize/InitializeMembers.php index 69447996..5f9fd0b7 100644 --- a/app/Initialize/InitializeMembers.php +++ b/app/Initialize/InitializeMembers.php @@ -5,11 +5,8 @@ namespace App\Initialize; use App\Initialize\Actions\ProcessRedisAction; use App\Nami\Api\CompleteMemberToRedisJob; use App\Setting\NamiSettings; -use Illuminate\Bus\Batch; -use Illuminate\Console\Command; use Illuminate\Support\Facades\Bus; use Illuminate\Support\Facades\Redis; -use Log; use Lorisleiva\Actions\Concerns\AsAction; use Zoomyboy\LaravelNami\Api; use Zoomyboy\LaravelNami\Data\MemberEntry as NamiMemberEntry; @@ -23,15 +20,14 @@ class InitializeMembers public function handle(Api $api): void { - $allMembers = collect([]); Redis::delete('members'); $jobs = $api->search([])->map(function (NamiMemberEntry $member) use ($api) { return new CompleteMemberToRedisJob($api, $member->groupId, $member->id); })->toArray(); - $batch = Bus::batch($jobs) - ->finally(function (Batch $batch) { + Bus::batch($jobs) + ->finally(function () { foreach (Redis::lrange('members', 0, -1) as $data) { ProcessRedisAction::dispatch(json_decode($data, true)); } @@ -41,7 +37,7 @@ class InitializeMembers ->dispatch(); } - public function asCommand(Command $command): int + public function asCommand(): int { $this->handle(app(NamiSettings::class)->login());