Catch errors in pushLazyJobs() and log them
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 20 Apr 2016 16:55:08 +0000 (09:55 -0700)
committerOri.livneh <ori@wikimedia.org>
Wed, 20 Apr 2016 17:34:40 +0000 (17:34 +0000)
This happens post-send anyway, so throwing errors is not
very useful and the other post-send updates are independent.

Change-Id: Ife8f9825da9592be1a38cf4c757550213838463b

includes/jobqueue/JobQueueGroup.php

index 982a3a0..2dd0615 100644 (file)
@@ -175,8 +175,13 @@ class JobQueueGroup {
         */
        public static function pushLazyJobs() {
                foreach ( self::$instances as $group ) {
-                       $group->push( $group->bufferedJobs );
-                       $group->bufferedJobs = [];
+                       try {
+                               $group->push( $group->bufferedJobs );
+                               $group->bufferedJobs = [];
+                       } catch ( Exception $e ) {
+                               // Get in as many jobs as possible and let other post-send updates happen
+                               MWExceptionHandler::logException( $e );
+                       }
                }
        }