Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.

Commit 5ae588f

Browse files
apple502jKenny2github
authored andcommitted
Use startAtomic and endAtomic
1 parent 8f0b9a9 commit 5ae588f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

SpecialHandleReports.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,14 @@ public function execute( $par ) {
241241
public function onPost( $par, $out, $user ) {
242242
if ($user->matchEditToken($this->getRequest()->getText( 'token' ))) {
243243
$dbw = wfGetDB( DB_MASTER );
244-
$dbw->begin();
244+
$dbw->startAtomic(__METHOD__);
245245
$dbw->update( 'report_reports', [
246246
'report_handled' => 1,
247247
'report_handled_by' => $user->getId(),
248248
'report_handled_by_text' => $user->getName(),
249249
'report_handled_timestamp' => wfTimestampNow()
250250
], [ 'report_id' => (int)$par ], __METHOD__ );
251-
$dbw->commit();
251+
$dbw->endAtomic(__METHOD__);
252252
$out->addHTML(Html::rawElement('div', [],
253253
wfMessage( 'report-has-been-handled' )->escaped()
254254
));

SpecialReport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,15 @@ static public function onPost( $par, $out, $request ) {
107107
));
108108
} else {
109109
$dbw = wfGetDB( DB_MASTER );
110-
$dbw->begin();
110+
$dbw->startAtomic(__METHOD__);
111111
$dbw->insert( 'report_reports', [
112112
'report_revid' => (int)$par,
113113
'report_reason' => $request->getText('reason'),
114114
'report_user' => $wgUser->getId(),
115115
'report_user_text' => $wgUser->getName(),
116116
'report_timestamp' => wfTimestampNow()
117117
], __METHOD__ );
118-
$dbw->commit();
118+
$dbw->endAtomic(__METHOD__);
119119
$out->addWikiMsg( 'report-success' );
120120
$out->addWikiMsg( 'returnto', '[[' . Revision::newFromId( (int)$par )->getTitle()->getPrefixedText() . ']]' );
121121
return;

0 commit comments

Comments
 (0)