-
Notifications
You must be signed in to change notification settings - Fork 22
Possible Fix for issue #34 #35
base: develop
Are you sure you want to change the base?
Conversation
…xes compatibility with php versions > 5.6
… parsing state for several seconds.
… phpdoc comments.
Hi @narkaTee, The changes look good, thank you again for doing this!
|
Hi @shakeelmohamed, no problem I've been very busy too. |
Hi @narkaTee, It looks like there are more merge conflicts 😄. Please let us know if you need further guidance here Please try the following, assuming you've already run step #1-3 from my previous comment:
After running #2, you should see the following index 6ed2483,87f7b56..0000000
--- a/Splunk/Job.php
+++ b/Splunk/Job.php
@@@ -33,7 -27,38 +33,42 @@@ class Splunk_Job extends Splunk_Entit
const DEFAULT_FETCH_DELAY_PER_RETRY = 0.1; // secs
// === Load ===
++<<<<<<< HEAD
+
++=======
+
+ /*
+ * Job requests sometimes yield an HTTP 204 code when they are in the
+ * process of being created. To hide this from the caller, transparently
+ * retry requests when an HTTP 204 is received.
+ */
+ 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);
+ }
+
++>>>>>>> origin/develop
protected function extractEntryFromRootXmlElement($xml)
{
// <entry> element is at the root of a job's Atom feed To resolve the conflict, edit /*
* Job requests sometimes yield an HTTP 204 code when they are in the
* process of being created. To hide this from the caller, transparently
* retry requests when an HTTP 204 is received.
*/
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);
} |
…2 to resolve conflicts Conflicts: Splunk/Job.php
I finally had some spare time to look at the conflict :) I resolved it and stumbled upon a test which is obsolete after my changes. |
Thanks @narkaTee! |
Fixes Issue #34