From: Aaron Schulz Date: Tue, 26 Apr 2016 22:09:28 +0000 (-0700) Subject: Optimize consistencyCheck() in FileBackendMultiwrite X-Git-Tag: 1.31.0-rc.0~7163 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/message.php?a=commitdiff_plain;h=48fc04e656d15c6c5ab19b0ffa8b386ee796381e;p=lhc%2Fweb%2Fwiklou.git Optimize consistencyCheck() in FileBackendMultiwrite doOperationsInternal() already set "preserveCache" but never actually filled it in to begin with. This should lower round trips if sync checks are enabled. Change-Id: Ica67b8d66e7602faed842408365edbd466688f61 --- diff --git a/includes/filebackend/FileBackendMultiWrite.php b/includes/filebackend/FileBackendMultiWrite.php index 0d7bf6696a..c432025c2c 100644 --- a/includes/filebackend/FileBackendMultiWrite.php +++ b/includes/filebackend/FileBackendMultiWrite.php @@ -241,6 +241,12 @@ class FileBackendMultiWrite extends FileBackend { return $status; // skip checks } + // Preload all of the stat info in as few round trips as possible... + foreach ( $this->backends as $backend ) { + $realPaths = $this->substPaths( $paths, $backend ); + $backend->preloadFileStat( [ 'srcs' => $realPaths, 'latest' => true ] ); + } + $mBackend = $this->backends[$this->masterIndex]; foreach ( $paths as $path ) { $params = [ 'src' => $path, 'latest' => true ];