]> source.dussan.org Git - nextcloud-server.git/commitdiff
add retry wrapper when reading files from swift 7409/head
authorRobin Appelman <robin@icewind.nl>
Mon, 4 Dec 2017 15:34:53 +0000 (16:34 +0100)
committerRobin Appelman <robin@icewind.nl>
Wed, 6 Dec 2017 14:43:00 +0000 (15:43 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
apps/files_external/lib/Lib/Storage/Swift.php
lib/private/Files/ObjectStore/Swift.php

index d32d6b3a19c13c22ae90f11c3b9e61c8480033a8..ff6b1e6271b1fc8cc5b5cc42eabd5d15659aad60 100644 (file)
@@ -39,6 +39,7 @@ use Guzzle\Http\Url;
 use Guzzle\Http\Exception\ClientErrorResponseException;
 use Icewind\Streams\CallbackWrapper;
 use Icewind\Streams\IteratorDirectory;
+use Icewind\Streams\RetryWrapper;
 use OpenCloud;
 use OpenCloud\Common\Exceptions;
 use OpenCloud\OpenStack;
@@ -385,7 +386,7 @@ class Swift extends \OC\Files\Storage\Common {
                                        stream_context_set_option($stream, 'swift','content', $streamInterface);
                                        if(!strrpos($streamInterface
                                                ->getMetaData('wrapper_data')[0], '404 Not Found')) {
-                                               return $stream;
+                                               return RetryWrapper::wrap($stream);
                                        }
                                        return false;
                                } catch (\Guzzle\Http\Exception\BadResponseException $e) {
index 36a1a4a873f4f0cdb6f189202e0dffae9812e477..725ed7fcaf36a0e4a1a3410c0aaf32093a09ffd7 100644 (file)
@@ -25,6 +25,7 @@
 namespace OC\Files\ObjectStore;
 
 use Guzzle\Http\Exception\ClientErrorResponseException;
+use Icewind\Streams\RetryWrapper;
 use OCP\Files\ObjectStore\IObjectStore;
 use OCP\Files\StorageAuthException;
 use OCP\Files\StorageNotAvailableException;
@@ -263,7 +264,7 @@ class Swift implements IObjectStore {
                // save the object content in the context of the stream to prevent it being gc'd until the stream is closed
                stream_context_set_option($stream, 'swift', 'content', $objectContent);
 
-               return $stream;
+               RetryWrapper::wrap($stream);
        }
 
        /**