maxAttempts; $attempt++) { $response = $this->http->getWithToken( "pull_updates/getStatusPartGenerationByNewCoreJson?operation_identity={$operationIdentity}", $accessToken ); $body = $response->json(); $status = $body['status'] ?? 'unknown'; Log::info('Vikon poll part status', [ 'operation' => $operationIdentity, 'status' => $status, 'attempt' => $attempt + 1, ]); if ($status === 'completed') { return ['status' => 'completed']; } if ($status === 'failed') { return [ 'status' => 'failed', 'error' => $body['message'] ?? 'Unknown error', ]; } if ($attempt < $this->maxAttempts - 1) { sleep($this->interval); } } return ['status' => 'timeout']; } }