Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the ability to provide custom retryMap #1488

Merged
merged 7 commits into from
Aug 7, 2018

Conversation

Yahav
Copy link
Contributor

@Yahav Yahav commented Jul 30, 2018

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Jul 30, 2018
@Yahav
Copy link
Contributor Author

Yahav commented Jul 30, 2018

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Jul 30, 2018
@mattwhisenhunt mattwhisenhunt requested a review from a team August 1, 2018 16:41
@@ -795,7 +795,7 @@ public function execute(RequestInterface $request, $expectedClass = null)
// this is where most of the grunt work is done
$http = $this->authorize();

return Google_Http_REST::execute($http, $request, $expectedClass, $this->config['retry']);
return Google_Http_REST::execute($http, $request, $expectedClass, null, $this->config['retry']);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Will be initiated like so:
$this->client = new Google_Client(array('retry'=>array('retries'=>99),'retryMap'=>$this->retryMap));
@@ -795,7 +796,7 @@ public function execute(RequestInterface $request, $expectedClass = null)
// this is where most of the grunt work is done
$http = $this->authorize();

return Google_Http_REST::execute($http, $request, $expectedClass, $this->config['retry']);
return Google_Http_REST::execute($http, $request, $expectedClass, $this->config['retry'], $this->config['retry_map']);

This comment was marked as spam.

This comment was marked as spam.

$this->config['retry'],
$this->config['retry_map']
);

This comment was marked as spam.

This comment was marked as spam.

@Yahav
Copy link
Contributor Author

Yahav commented Aug 5, 2018

Can someone merge this?

@dwsupplee
Copy link
Contributor

@mattwhisenhunt is this okay to merge?

@mattwhisenhunt mattwhisenhunt merged commit 9edd15c into googleapis:master Aug 7, 2018
@bshaffer bshaffer mentioned this pull request May 21, 2019
@ggmartins091
Copy link

ggmartins091 commented Mar 10, 2021

Guys, is this right?

I know this fixes the ability to provide the custom retryMap, but why are we passing $this->config['retry'] as the third argument here when in reality it expects the whole config array as can be seen here and here

Even the retry index in that array is incorrect, the Runner class looks for an index called retries. But still, we should pass the whole config array.

Am I missing something here?

@dwsupplee
Copy link
Contributor

@ggmartins091 it looks correct to me. $this->config['retry'] is intended to be the configuration array for the Runner, as seen here, not a specific number of retry attempts.

@ggmartins091
Copy link

@dwsupplee Oh, my bad. I get it now.

So for me to change the number of retries I would need to do new Google_Client(['retry' => ['retries' => 3]]);

Thats what I was missing. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants