[FileBackend] Made copy script retry on batch copy failure.
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 12 Jul 2012 23:33:27 +0000 (16:33 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 12 Jul 2012 23:33:27 +0000 (16:33 -0700)
Change-Id: I5db35371a41fa72d449cba1fb7e15f19f0cefa21

maintenance/copyFileBackend.php

index 184bf3d..548a33b 100644 (file)
@@ -153,6 +153,10 @@ class CopyFileBackend extends Maintenance {
 
                $t_start = microtime( true );
                $status = $dst->doQuickOperations( $ops );
+               if ( !$status->isOK() ) {
+                       sleep( 10 ); // wait and retry copy again
+                       $status = $dst->doQuickOperations( $ops );
+               }
                $ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 );
                if ( !$status->isOK() ) {
                        $this->error( print_r( $status->getErrorsArray(), true ) );