diff --git a/config/vufind/Alma.ini b/config/vufind/Alma.ini index f5bda3647c7df1221eeef3f95d08075b6b4f1bea..7c5b26fe8be91a1ed4d24f06430a54141b910418 100644 --- a/config/vufind/Alma.ini +++ b/config/vufind/Alma.ini @@ -3,6 +3,8 @@ apiBaseUrl = "https://api-eu.hosted.exlibrisgroup.com/almaws/v1" ; An API key configured to allow access to Alma: apiKey = "your-key-here" +; Timeout in seconds when making HTTP requests to the Alma APIs: +http_timeout = 30 ; Patron login method to use. The following options are available: ; vufind Use VuFind's user database for authentication -- patrons are retrieved ; from Alma without a password (default) diff --git a/module/VuFind/src/VuFind/ILS/Driver/Alma.php b/module/VuFind/src/VuFind/ILS/Driver/Alma.php index 6c7ce16898907a95aab31c81d269ee56e1e972af..51df496fdc69599d3fe89c2296d8ceeb72e20bb4 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Alma.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Alma.php @@ -156,6 +156,10 @@ class Alma extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterface // Set method $client->setMethod($method); + // Set timeout + $timeout = $this->config['Catalog']['http_timeout'] ?? 30; + $client->setOptions(['timeout' => $timeout]); + // Set other GET parameters (apikey and other URL parameters are used // also with e.g. POST requests) $client->setParameterGet($paramsGet);