Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • itpublic/drupal/modules/uib-api-connector
1 result
Show changes
Commits on Source (3)
......@@ -14,10 +14,10 @@ interface ApiConnectorInterface {
/**
* Returns the api key.
*
* @return string
* @return string|false
* The api key.
*/
public function getApiKey(): string;
public function getApiKey(): string|false;
/**
* Returns the base url of the api_connector.
......
......@@ -159,7 +159,7 @@ abstract class ApiConnectorPluginBase extends PluginBase implements ApiConnector
/**
* {@inheritdoc}
*/
public function getApiKey(): string {
public function getApiKey(): string|false {
$apiKey = $this->settings->get("uib_{$this->getPluginId()}_api_key", '');
if (empty($apiKey)) {
$errorMessage = 'API key is empty. Please set value for @setting in settings.php';
......@@ -189,9 +189,9 @@ abstract class ApiConnectorPluginBase extends PluginBase implements ApiConnector
return [
'retry_enabled' => TRUE,
'retry_on_timeout' => TRUE,
'connect_timeout' => 60,
'timeout' => 60,
'max_retry_attempts' => 5,
'connect_timeout' => 2,
'timeout' => 6,
'max_retry_attempts' => 2,
'retry_on_status' => [502, 503, 504, 429, 408],
'on_retry_callback' => fn (int $attemptNumber, float $delay, RequestInterface &$request, array &$options, ?ResponseInterface $response) =>
$this->retryListener($attemptNumber, $delay, $request, $options, $response),
......