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

Change subject: SqlBagOStuff: reuse code of parent class
......................................................................


SqlBagOStuff: reuse code of parent class

It'll be easier to change the time threshold (currently 10 years)
in the future.

Change-Id: I24005148d40c47905d5b20cfd506decef2ae447e
---
M includes/objectcache/SqlBagOStuff.php
1 file changed, 3 insertions(+), 10 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index d8d86db..3585e57 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -322,9 +322,7 @@
                        if ( $exptime == 0 ) {
                                $encExpiry = $this->getMaxDateTime( $db );
                        } else {
-                               if ( $exptime < 3.16e8 ) { # ~10 years
-                                       $exptime += time();
-                               }
+                               $exptime = $this->convertExpiry( $exptime );
                                $encExpiry = $db->timestamp( $exptime );
                        }
                        foreach ( $serverKeys as $tableName => $tableKeys ) {
@@ -377,10 +375,7 @@
                        if ( $exptime == 0 ) {
                                $encExpiry = $this->getMaxDateTime( $db );
                        } else {
-                               if ( $exptime < 3.16e8 ) { # ~10 years
-                                       $exptime += time();
-                               }
-
+                               $exptime = $this->convertExpiry( $exptime );
                                $encExpiry = $db->timestamp( $exptime );
                        }
                        // (bug 24425) use a replace if the db supports it 
instead of
@@ -421,9 +416,7 @@
                        if ( $exptime == 0 ) {
                                $encExpiry = $this->getMaxDateTime( $db );
                        } else {
-                               if ( $exptime < 3.16e8 ) { # ~10 years
-                                       $exptime += time();
-                               }
+                               $exptime = $this->convertExpiry( $exptime );
                                $encExpiry = $db->timestamp( $exptime );
                        }
                        // (bug 24425) use a replace if the db supports it 
instead of

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I24005148d40c47905d5b20cfd506decef2ae447e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Taueres <santoro....@gmail.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to