connect('redis', 6379); CLI::write('Worker started...'); while (true) { // 큐에서 데이터 꺼내기 (blocking pop) $item = $redis->brPop(['naver:queue'], 5); if ($item) { $payload = json_decode($item[1], true); $this->process($payload); } } } private function process($payload) { $articleNum = $payload['articleNumbr']; $requestType = $payload['reqeustType']; if (in_array($requestType, ['REG','MOD'])) { $client = \Config\Services::curlrequest(); $url = "https://네이버CP/kiso/center/verification-article/{$articleNum}"; try { $response = $client->get($url); CLI::write("Processed {$requestType} for {$articleNum}: " . $response->getStatusCode()); } catch (\Exception $e) { CLI::error("Error processing {$articleNum}: " . $e->getMessage()); } } else { CLI::write("Skipping {$requestType} for {$articleNum}"); } } }