Skip to content

Commit 9745e6d

Browse files
authored
feat(php): add setMaxRetries (#4448)
1 parent 443f314 commit 9745e6d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

playground/php/src/search.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
$env['ALGOLIA_ADMIN_KEY']
1616
);
1717

18+
$config->setMaxRetries(200);
19+
var_dump($config->getDefaultMaxRetries());
20+
1821
//$config->setFullHosts(
1922
// [
2023
// 'http://localhost:6677',

templates/php/client_config.mustache

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ class {{configClassname}} extends {{#hasRegionalHost}}ConfigWithRegion{{/hasRegi
4848
return $this->config['waitTaskTimeBeforeRetry'];
4949
}
5050

51+
/**
52+
* Sets the max retries value used in the Search helpers (e.g. replaceAllobjects)
53+
*
54+
* @param number $maxRetries the user agent of the api client
55+
*
56+
* @return $this
57+
*/
58+
public function setMaxRetries($maxRetries)
59+
{
60+
$this->config['defaultMaxRetries'] = $maxRetries;
61+
62+
return $this;
63+
}
64+
5165
public function getDefaultMaxRetries()
5266
{
5367
return $this->config['defaultMaxRetries'];
@@ -73,4 +87,4 @@ class {{configClassname}} extends {{#hasRegionalHost}}ConfigWithRegion{{/hasRegi
7387
{{/isSearchClient}}
7488
];
7589
}
76-
}
90+
}

0 commit comments

Comments
 (0)