protected function fetch($fetchArgs) { $fetchArgs = array_merge(array('maxTries' => Splunk_Job::DEFAULT_FETCH_MAX_TRIES, 'delayPerRetry' => Splunk_Job::DEFAULT_FETCH_DELAY_PER_RETRY), $fetchArgs); for ($numTries = 0; $numTries < $fetchArgs['maxTries']; $numTries++) { $response = parent::fetch($fetchArgs); if ($this->isFullResponse($response)) { return $response; } usleep($fetchArgs['delayPerRetry'] * 1000000); } // Give up throw new Splunk_HttpException($response); }
protected function fetch($fetchArgs) { $fetchArgs = array_merge(array('maxTries' => Splunk_Job::DEFAULT_FETCH_MAX_TRIES, 'delayPerRetry' => Splunk_Job::DEFAULT_FETCH_DELAY_PER_RETRY), $fetchArgs); for ($numTries = 0; $numTries < $fetchArgs['maxTries']; $numTries++) { $response = parent::fetch($fetchArgs); if ($this->isFullResponse($response)) { return $response; } usleep($fetchArgs['delayPerRetry'] * 1000000); } // If actually HTTP 200, convert to a simulated HTTP 204 response if ($response->status != 204) { $response->status = 204; $response->reason = "Timed out waiting for job to parse."; } // Give up throw new Splunk_HttpException($response); }