mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 01:10:07 +00:00
Initialize $success
Followup I85452d0f0afe974d26a575e000f6ae2ceeddf06c * initialize "$success = true" before using it in a loop to keep track of the overall success of all batches. * Add check for readOnly db in markUnRead() and markAllRead(), like it was done in markRead() Bug: T202672 Change-Id: Ifdfa93059268d5b02ba3e0e885661ce593845791
This commit is contained in:
parent
8bcc8107b0
commit
a5ececbb7e
|
@ -91,7 +91,11 @@ class EchoUserNotificationGateway {
|
|||
}
|
||||
|
||||
$dbw = $this->getDB( DB_MASTER );
|
||||
if ( $dbw->isReadOnly() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$success = true;
|
||||
foreach ( array_chunk( $eventIDs, $wgUpdateRowsPerQuery ) as $batch ) {
|
||||
$success = $dbw->update(
|
||||
self::$notificationTable,
|
||||
|
@ -114,6 +118,9 @@ class EchoUserNotificationGateway {
|
|||
*/
|
||||
public function markAllRead() {
|
||||
$dbw = $this->getDB( DB_MASTER );
|
||||
if ( $dbw->isReadOnly() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $dbw->update(
|
||||
self::$notificationTable,
|
||||
|
|
Loading…
Reference in a new issue