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 "API: Don't handle non-preflight OPTIONS as CORS"
[lhc/web/wiklou.git]
/
includes
/
utils
/
BatchRowWriter.php
diff --git
a/includes/utils/BatchRowWriter.php
b/includes/utils/BatchRowWriter.php
index
ffb7053
..
70afb91
100644
(file)
--- a/
includes/utils/BatchRowWriter.php
+++ b/
includes/utils/BatchRowWriter.php
@@
-20,6
+20,9
@@
* @file
* @ingroup Maintenance
*/
* @file
* @ingroup Maintenance
*/
+use Wikimedia\Rdbms\IDatabase;
+use \MediaWiki\MediaWikiServices;
+
class BatchRowWriter {
/**
* @var IDatabase $db The database to write to
class BatchRowWriter {
/**
* @var IDatabase $db The database to write to
@@
-54,7
+57,8
@@
class BatchRowWriter {
* names to update values to apply to the row.
*/
public function write( array $updates ) {
* names to update values to apply to the row.
*/
public function write( array $updates ) {
- $this->db->begin();
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $ticket = $lbFactory->getEmptyTransactionTicket( __METHOD__ );
foreach ( $updates as $update ) {
$this->db->update(
foreach ( $updates as $update ) {
$this->db->update(
@@
-65,7
+69,6
@@
class BatchRowWriter {
);
}
);
}
- $this->db->commit();
- wfGetLBFactory()->waitForReplication();
+ $lbFactory->commitAndWaitForReplication( __METHOD__, $ticket );
}
}
}
}