X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FsyncFileBackend.php;h=a29647b50a29b0e78be0985d5a412bd2ff7fc496;hb=850373ba9c606594cd5b8069664c0eeb5d87562e;hp=2dcf7571942b33e94f8f6a0313a689f445aa3695;hpb=0e5c2ee3f23eadabb9d9856868b4406cb433f753;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/syncFileBackend.php b/maintenance/syncFileBackend.php index 2dcf757194..a29647b50a 100644 --- a/maintenance/syncFileBackend.php +++ b/maintenance/syncFileBackend.php @@ -17,11 +17,18 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * http://www.gnu.org/copyleft/gpl.html * + * @file * @ingroup Maintenance */ -require_once( dirname( __FILE__ ) . '/Maintenance.php' ); +require_once( __DIR__ . '/Maintenance.php' ); +/** + * Maintenance script that syncs one file backend to another based on + * the journal of later. + * + * @ingroup Maintenance + */ class SyncFileBackend extends Maintenance { public function __construct() { parent::__construct(); @@ -202,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" .