mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
Merge "Revert "Call IDatabase::timestamp before inserting rows""
This commit is contained in:
commit
3ce93e3368
|
@ -117,17 +117,13 @@ class EchoUnreadWikis {
|
||||||
if ( $alertCount || $msgCount ) {
|
if ( $alertCount || $msgCount ) {
|
||||||
$values = [
|
$values = [
|
||||||
'euw_alerts' => $alertCount,
|
'euw_alerts' => $alertCount,
|
||||||
'euw_alerts_ts' => $dbw->timestamp(
|
'euw_alerts_ts' => $alertTime
|
||||||
$alertTime
|
|
||||||
? $alertTime->getTimestamp( TS_MW )
|
? $alertTime->getTimestamp( TS_MW )
|
||||||
: static::DEFAULT_TS
|
: static::DEFAULT_TS,
|
||||||
),
|
|
||||||
'euw_messages' => $msgCount,
|
'euw_messages' => $msgCount,
|
||||||
'euw_messages_ts' => $dbw->timestamp(
|
'euw_messages_ts' => $msgTime
|
||||||
$msgTime
|
|
||||||
? $msgTime->getTimestamp( TS_MW )
|
? $msgTime->getTimestamp( TS_MW )
|
||||||
: static::DEFAULT_TS
|
: static::DEFAULT_TS,
|
||||||
),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// when there is unread alert(s) and/or message(s), upsert the row
|
// when there is unread alert(s) and/or message(s), upsert the row
|
||||||
|
|
|
@ -25,8 +25,6 @@ class EchoNotificationMapper extends EchoAbstractMapper {
|
||||||
static function ( IDatabase $dbw, $fname ) use ( $row, $listeners ) {
|
static function ( IDatabase $dbw, $fname ) use ( $row, $listeners ) {
|
||||||
$row['notification_timestamp'] =
|
$row['notification_timestamp'] =
|
||||||
$dbw->timestamp( $row['notification_timestamp'] );
|
$dbw->timestamp( $row['notification_timestamp'] );
|
||||||
$row['notification_read_timestamp'] =
|
|
||||||
$dbw->timestampOrNull( $row['notification_read_timestamp'] );
|
|
||||||
$dbw->insert( 'echo_notification', $row, $fname );
|
$dbw->insert( 'echo_notification', $row, $fname );
|
||||||
foreach ( $listeners as $listener ) {
|
foreach ( $listeners as $listener ) {
|
||||||
$dbw->onTransactionCommitOrIdle( $listener, $fname );
|
$dbw->onTransactionCommitOrIdle( $listener, $fname );
|
||||||
|
|
Loading…
Reference in a new issue