jenkins-bot has submitted this change and it was merged.

Change subject: resourceloader: Remove CacheEpoch from 
MessageBlobStore::getFromDB
......................................................................


resourceloader: Remove CacheEpoch from MessageBlobStore::getFromDB

CacheEpoch isn't meant for this (it's meant for page cache), I can't
imagine a scenario in which we'd want to bump that to invalidate
MessageBlobStore. It should be standalone and can be easily cleared
if needed by truncating the relevant table (it's automatically
repopulated).

This also removes wfTimestamp/DateTime overhead.

Change-Id: Iab06edbf71f20f3430207a80df90131c79dc03a7
---
M includes/cache/MessageBlobStore.php
1 file changed, 4 insertions(+), 8 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/cache/MessageBlobStore.php 
b/includes/cache/MessageBlobStore.php
index 63d8c7e..b7c70c1 100644
--- a/includes/cache/MessageBlobStore.php
+++ b/includes/cache/MessageBlobStore.php
@@ -374,7 +374,6 @@
                        return array();
                }
 
-               $config = $resourceLoader->getConfig();
                $retval = array();
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'msg_resource',
@@ -390,13 +389,10 @@
                                throw new MWException( __METHOD__ . ' passed an 
invalid module name' );
                        }
 
-                       // Update the module's blobs if the set of messages 
changed or if the blob is
-                       // older than the CacheEpoch setting
-                       $keys = array_keys( FormatJson::decode( $row->mr_blob, 
true ) );
-                       $values = array_values( array_unique( 
$module->getMessages() ) );
-                       if ( $keys !== $values
-                               || wfTimestamp( TS_MW, $row->mr_timestamp ) <= 
$config->get( 'CacheEpoch' )
-                       ) {
+                       // Update the module's blob if the list of messages 
changed
+                       $blobKeys = array_keys( FormatJson::decode( 
$row->mr_blob, true ) );
+                       $moduleMsgs = array_values( array_unique( 
$module->getMessages() ) );
+                       if ( $blobKeys !== $moduleMsgs ) {
                                $retval[$row->mr_resource] = 
$this->updateModule( $row->mr_resource, $module, $lang );
                        } else {
                                $retval[$row->mr_resource] = $row->mr_blob;

-- 
To view, visit https://gerrit.wikimedia.org/r/247723
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iab06edbf71f20f3430207a80df90131c79dc03a7
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to