dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Correct variable names in @param to match method declarations"
[lhc/web/wiklou.git]
/
includes
/
filebackend
/
FileOpBatch.php
diff --git
a/includes/filebackend/FileOpBatch.php
b/includes/filebackend/FileOpBatch.php
index
b42e140
..
b0d83e0
100644
(file)
--- a/
includes/filebackend/FileOpBatch.php
+++ b/
includes/filebackend/FileOpBatch.php
@@
-61,6
+61,7
@@
class FileOpBatch {
$n = count( $performOps );
if ( $n > self::MAX_BATCH_SIZE ) {
$status->fatal( 'backend-fail-batchsize', $n, self::MAX_BATCH_SIZE );
$n = count( $performOps );
if ( $n > self::MAX_BATCH_SIZE ) {
$status->fatal( 'backend-fail-batchsize', $n, self::MAX_BATCH_SIZE );
+
return $status;
}
return $status;
}
@@
-151,6
+152,8
@@
class FileOpBatch {
// We can't continue (even with $ignoreErrors) as $predicates is wrong.
// Log the remaining ops as failed for recovery...
foreach ( $performOpsBatch as $i => $fileOp ) {
// We can't continue (even with $ignoreErrors) as $predicates is wrong.
// Log the remaining ops as failed for recovery...
foreach ( $performOpsBatch as $i => $fileOp ) {
+ $status->success[$i] = false;
+ ++$status->failCount;
$performOpsBatch[$i]->logFailure( 'attempt_aborted' );
}
continue;
$performOpsBatch[$i]->logFailure( 'attempt_aborted' );
}
continue;
@@
-164,7
+167,11
@@
class FileOpBatch {
// or the backend does not support async ops and did it synchronously.
foreach ( $performOpsBatch as $i => $fileOp ) {
if ( !isset( $status->success[$i] ) ) { // didn't already fail in precheck()
// or the backend does not support async ops and did it synchronously.
foreach ( $performOpsBatch as $i => $fileOp ) {
if ( !isset( $status->success[$i] ) ) { // didn't already fail in precheck()
- $subStatus = $fileOp->attemptAsync();
+ // Parallel ops may be disabled in config due to missing dependencies,
+ // (e.g. needing popen()). When they are, $performOpsBatch has size 1.
+ $subStatus = ( count( $performOpsBatch ) > 1 )
+ ? $fileOp->attemptAsync()
+ : $fileOp->attempt();
if ( $subStatus->value instanceof FileBackendStoreOpHandle ) {
$opHandles[$i] = $subStatus->value; // deferred
} else {
if ( $subStatus->value instanceof FileBackendStoreOpHandle ) {
$opHandles[$i] = $subStatus->value; // deferred
} else {