Made executeReadyPeriodicTasks avoid using merge() when not needed
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 4 Jun 2014 18:23:23 +0000 (11:23 -0700)
committerOri Livneh <ori@wikimedia.org>
Wed, 4 Jun 2014 22:34:57 +0000 (15:34 -0700)
Change-Id: I9bb3a5af6ebd12ac5a31578e17142fb0a2dba029

includes/jobqueue/JobQueueGroup.php

index 16908a7..98a78c5 100644 (file)
@@ -389,6 +389,10 @@ class JobQueueGroup {
                        }
                }
 
+               if ( $count === 0 ) {
+                       return $count; // nothing to update
+               }
+
                $wgMemc->merge( $key, function ( $cache, $key, $lastRuns ) use ( $tasksRun ) {
                        if ( is_array( $lastRuns ) ) {
                                foreach ( $tasksRun as $type => $tasks ) {