@@ 503-518 (lines=16) @@ | ||
500 | $masterStatus = $this->backends[$this->masterIndex]->doQuickOperations( $realOps ); |
|
501 | $status->merge( $masterStatus ); |
|
502 | // Propagate the operations to the clone backends... |
|
503 | foreach ( $this->backends as $index => $backend ) { |
|
504 | if ( $index === $this->masterIndex ) { |
|
505 | continue; // done already |
|
506 | } |
|
507 | ||
508 | $realOps = $this->substOpBatchPaths( $ops, $backend ); |
|
509 | if ( $this->asyncWrites && !$this->hasVolatileSources( $ops ) ) { |
|
510 | DeferredUpdates::addCallableUpdate( |
|
511 | function() use ( $backend, $realOps ) { |
|
512 | $backend->doQuickOperations( $realOps ); |
|
513 | } |
|
514 | ); |
|
515 | } else { |
|
516 | $status->merge( $backend->doQuickOperations( $realOps ) ); |
|
517 | } |
|
518 | } |
|
519 | // Make 'success', 'successCount', and 'failCount' fields reflect |
|
520 | // the overall operation, rather than all the batches for each backend. |
|
521 | // Do this by only using success values from the master backend's batch. |
|
@@ 557-572 (lines=16) @@ | ||
554 | $masterStatus = $this->backends[$this->masterIndex]->$method( $realParams ); |
|
555 | $status->merge( $masterStatus ); |
|
556 | ||
557 | foreach ( $this->backends as $index => $backend ) { |
|
558 | if ( $index === $this->masterIndex ) { |
|
559 | continue; // already done |
|
560 | } |
|
561 | ||
562 | $realParams = $this->substOpPaths( $params, $backend ); |
|
563 | if ( $this->asyncWrites ) { |
|
564 | DeferredUpdates::addCallableUpdate( |
|
565 | function() use ( $backend, $method, $realParams ) { |
|
566 | $backend->$method( $realParams ); |
|
567 | } |
|
568 | ); |
|
569 | } else { |
|
570 | $status->merge( $backend->$method( $realParams ) ); |
|
571 | } |
|
572 | } |
|
573 | ||
574 | return $status; |
|
575 | } |