]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Configure timeout
authoradev <adev2000@gmail.com>
Sun, 12 Nov 2017 11:15:02 +0000 (12:15 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 28 May 2019 09:42:27 +0000 (11:42 +0200)
app/config/config.yml
src/Wallabag/CoreBundle/Helper/HttpClientFactory.php

index 309945c501b7777c53002d5075d2f443ef5d8ad8..bbcc682f989f9d7e5820f92f7152111e9c38c516 100644 (file)
@@ -375,6 +375,9 @@ httplug:
     clients:
         wallabag_core:
             factory: 'wallabag_core.http_client_factory'
+            config:
+                defaults:
+                    timeout: 10
             plugins: ['httplug.plugin.logger']
         wallabag_core.entry.download_images:
             factory: 'httplug.factory.auto'
index 4899d3d41afbfeb1bd6589d653b47481bab9e0a4..3e19a7be1f4a3943b45fd2fe1ec873bb94a0c145 100644 (file)
@@ -60,13 +60,17 @@ class HttpClientFactory implements ClientFactory
         $this->logger->log('debug', 'Restricted access config enabled?', ['enabled' => (int) $this->restrictedAccess]);
 
         if (0 === (int) $this->restrictedAccess) {
-            return new GuzzleAdapter(new GuzzleClient());
+            return new GuzzleAdapter(new GuzzleClient($config));
         }
 
         // we clear the cookie to avoid websites who use cookies for analytics
         $this->cookieJar->clear();
-        // need to set the (shared) cookie jar
-        $guzzle = new GuzzleClient(['defaults' => ['cookies' => $this->cookieJar]]);
+        if (!isset($config['defaults']['cookies'])) {
+            // need to set the (shared) cookie jar
+            $config['defaults']['cookies'] = $this->cookieJar;
+        }
+
+        $guzzle = new GuzzleClient($config);
         foreach ($this->subscribers as $subscriber) {
             $guzzle->getEmitter()->attach($subscriber);
         }