Merge "Quick-fail refreshLinksJob if the triggering revision isn't the latest"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 2 May 2016 20:54:48 +0000 (20:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 2 May 2016 20:54:48 +0000 (20:54 +0000)
includes/jobqueue/jobs/RefreshLinksJob.php

index 927cafd..c297715 100644 (file)
@@ -154,6 +154,13 @@ class RefreshLinksJob extends Job {
                        return false; // just deleted?
                }
 
+               if ( !$revision->isCurrent() ) {
+                       // If the revision isn't current, there's no point in doing a bunch
+                       // of work just to fail at the lockAndGetLatest() check later.
+                       $this->setLastError( "Revision {$revision->getId()} is not current" );
+                       return false;
+               }
+
                $content = $revision->getContent( Revision::RAW );
                if ( !$content ) {
                        // If there is no content, pretend the content is empty