Skip to content
Snippets Groups Projects
Commit 2447b993 authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Add retry to work around intermittent API errors. (#1641)

- Resolves VUFIND-1405.
parent 5407958e
Branches
Tags
No related merge requests found
......@@ -28,6 +28,7 @@
namespace VuFind\Search\EDS;
use Interop\Container\ContainerInterface;
use VuFindSearch\Backend\EDS\ApiException;
/**
* Factory for EDS search options objects.
......@@ -67,7 +68,12 @@ class OptionsFactory extends \VuFind\Search\Options\OptionsFactory
if (!isset($session->info)) {
$backend = $container->get(\VuFind\Search\BackendManager::class)
->get('EDS');
$backend->getSessionToken();
try {
$backend->getSessionToken();
} catch (ApiException $e) {
// Retry once to work around occasional 106 errors:
$backend->getSessionToken();
}
}
return parent::__invoke($container, $requestedName, [$session->info]);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment