From: Aaron Date: Wed, 5 Sep 2012 17:58:26 +0000 (-0700) Subject: Made backend sync script handle random errors better. X-Git-Tag: 1.31.0-rc.0~22414 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=5f04f28e6a0eb9b8639fb7f0751235cd2d5bc1f5;p=lhc%2Fweb%2Fwiklou.git Made backend sync script handle random errors better. Change-Id: I3ad5d9d0768480d8be4bb480fe653238d203a95c --- diff --git a/maintenance/syncFileBackend.php b/maintenance/syncFileBackend.php index 2e1d1c3f59..a29647b50a 100644 --- a/maintenance/syncFileBackend.php +++ b/maintenance/syncFileBackend.php @@ -209,7 +209,11 @@ class SyncFileBackend extends Maintenance { } $t_start = microtime( true ); - $status->merge( $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) ) ); + $status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) ); + if ( !$status->isOK() ) { + sleep( 10 ); // wait and retry copy again + $status = $dst->doQuickOperations( $ops, array( 'bypassReadOnly' => 1 ) ); + } $ellapsed_ms = floor( ( microtime( true ) - $t_start ) * 1000 ); if ( $status->isOK() && $this->getOption( 'verbose' ) ) { $this->output( "Synchronized these file(s) [{$ellapsed_ms}ms]:\n" .