X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdeferred%2FLinksDeletionUpdate.php;h=f579a1f12fe572ab65d94419b8216b7135d2944e;hb=21948ec459cbb99167c09b59b7296b7f5d502aa0;hp=ca29078c63191812242bf36824fbae069dff1e3c;hpb=9b4fd6a6c054a8b012ea0d358478f3ee1c392469;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/deferred/LinksDeletionUpdate.php b/includes/deferred/LinksDeletionUpdate.php index ca29078c63..f579a1f12f 100644 --- a/includes/deferred/LinksDeletionUpdate.php +++ b/includes/deferred/LinksDeletionUpdate.php @@ -29,7 +29,7 @@ use Wikimedia\Rdbms\IDatabase; class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate { /** @var WikiPage */ protected $page; - /** @var integer */ + /** @var int */ protected $pageId; /** @var string */ protected $timestamp; @@ -39,7 +39,7 @@ class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate { /** * @param WikiPage $page Page we are updating - * @param integer|null $pageId ID of the page we are updating [optional] + * @param int|null $pageId ID of the page we are updating [optional] * @param string|null $timestamp TS_MW timestamp of deletion * @throws MWException */ @@ -106,7 +106,11 @@ class LinksDeletionUpdate extends DataUpdate implements EnqueueableDataUpdate { __METHOD__ ); if ( $row ) { - Category::newFromRow( $row, $title )->refreshCounts(); + $cat = Category::newFromRow( $row, $title ); + // T166757: do the update after the main job DB commit + DeferredUpdates::addCallableUpdate( function () use ( $cat ) { + $cat->refreshCounts(); + } ); } }