Merge "Add update()/insert() comments to IDatabase"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 16 Feb 2017 19:34:21 +0000 (19:34 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 16 Feb 2017 19:34:21 +0000 (19:34 +0000)
includes/jobqueue/jobs/RecentChangesUpdateJob.php
languages/messages/MessagesExt.php
resources/src/mediawiki.skinning/interface.css

index 0e90674..5c73308 100644 (file)
@@ -128,8 +128,10 @@ class RecentChangesUpdateJob extends Job {
                                $dbw->setSessionOptions( [ 'connTimeout' => 900 ] );
 
                                $lockKey = wfWikiID() . '-activeusers';
-                               if ( !$dbw->lock( $lockKey, __METHOD__, 1 ) ) {
-                                       return; // exclusive update (avoids duplicate entries)
+                               if ( !$dbw->lockIsFree( $lockKey, __METHOD__ ) || !$dbw->lock( $lockKey, __METHOD__, 1 ) ) {
+                                       // Exclusive update (avoids duplicate entries)… it's usually fine to just drop out here,
+                                       // if the Job is already running.
+                                       return;
                                }
 
                                $nowUnix = time();
@@ -168,15 +170,6 @@ class RecentChangesUpdateJob extends Job {
                                        $names[$row->rc_user_text] = $row->lastedittime;
                                }
 
-                               // Rotate out users that have not edited in too long (according to old data set)
-                               $dbw->delete( 'querycachetwo',
-                                       [
-                                               'qcc_type' => 'activeusers',
-                                               'qcc_value < ' . $dbw->addQuotes( $nowUnix - $days * 86400 ) // TS_UNIX
-                                       ],
-                                       __METHOD__
-                               );
-
                                // Find which of the recently active users are already accounted for
                                if ( count( $names ) ) {
                                        $res = $dbw->select( 'querycachetwo',
@@ -184,9 +177,13 @@ class RecentChangesUpdateJob extends Job {
                                                [
                                                        'qcc_type' => 'activeusers',
                                                        'qcc_namespace' => NS_USER,
-                                                       'qcc_title' => array_keys( $names ) ],
+                                                       'qcc_title' => array_keys( $names ),
+                                                       'qcc_value >= ' . $dbw->addQuotes( $nowUnix - $days * 86400 ), // TS_UNIX
+                                                ],
                                                __METHOD__
                                        );
+                                       // Note: In order for this to be actually consistent, we would need
+                                       // to update these rows with the new lastedittime.
                                        foreach ( $res as $row ) {
                                                unset( $names[$row->user_name] );
                                        }
@@ -224,6 +221,16 @@ class RecentChangesUpdateJob extends Job {
                                );
 
                                $dbw->unlock( $lockKey, __METHOD__ );
+
+                               // Rotate out users that have not edited in too long (according to old data set)
+                               $dbw->delete( 'querycachetwo',
+                                       [
+                                               'qcc_type' => 'activeusers',
+                                               'qcc_value < ' . $dbw->addQuotes( $nowUnix - $days * 86400 ) // TS_UNIX
+                                       ],
+                                       __METHOD__
+                               );
+
                        },
                        __METHOD__
                );
index 2bf6ce2..7b3b31a 100644 (file)
@@ -25,8 +25,13 @@ $namespaceNames = [
        NS_TEMPLATE_TALK    => 'Prantilla_caraba',
        NS_HELP             => 'Ayua',
        NS_HELP_TALK        => 'Ayua_caraba',
-       NS_CATEGORY         => 'Categoria',
-       NS_CATEGORY_TALK    => 'Categoria_caraba',
+       NS_CATEGORY         => 'Categoría',
+       NS_CATEGORY_TALK    => 'Categoría_caraba',
+];
+
+$namespaceAliases = [ // T157846
+       'Categoria' => NS_CATEGORY,
+       'Categoria_caraba' => NS_CATEGORY_TALK,
 ];
 
 $namespaceGenderAliases = [
index 7dbcd4d..d3f188a 100644 (file)
 
 textarea {
        /* Support Firefox: Border rule required to override system appearance on Linux */
-       border: 1px solid #c0c0c0;
+       border: 1px solid #a2a9b1;
 }
 
 .editOptions {
-       background-color: #f0f0f0;
-       border: 1px solid #c0c0c0;
+       background-color: #f8f9fa;
+       border: 1px solid #c8ccd1;
        border-top: none;
        padding: 1em 1em 1.5em 1em;
        margin-bottom: 2em;