Make merged MergeableUpdate items always go to the end of the queue
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 11 Oct 2018 21:51:36 +0000 (14:51 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 11 Oct 2018 21:51:36 +0000 (14:51 -0700)
Change-Id: I2e8aa28f7426470d9b8b9e11b902deea793069b3

includes/deferred/DeferredUpdates.php

index e6a0e81..47c9f6f 100644 (file)
@@ -146,6 +146,10 @@ class DeferredUpdates {
                                /** @var MergeableUpdate $existingUpdate */
                                $existingUpdate = $queue[$class];
                                $existingUpdate->merge( $update );
+                               // Move the update to the end to handle things like mergeable purge
+                               // updates that might depend on the prior updates in the queue running
+                               unset( $queue[$class] );
+                               $queue[$class] = $existingUpdate;
                        } else {
                                $queue[$class] = $update;
                        }