Example #1
0
 /**
  * Refreshes this entity's properties from the Splunk server
  * if the search is scheduled.
  * 
  * @return Splunk_Job            This Job.
  * @throws Splunk_IOException
  */
 public function refresh()
 {
     if ($this->isReady()) {
         return parent::refresh();
     }
     return $this;
 }
Example #2
0
 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);
 }
Example #3
0
 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);
 }