* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
+ * @file
* @ingroup Maintenance
*/
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();
}
$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" .