From d31ecefc1cef6c9ba041fc454060b0bca1a297c4 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 22 Sep 2016 19:15:22 -0700 Subject: [PATCH] Add transaction ticket to LinksUpdateComplete hook This lets callers use commitAndWaitForReplication() more easily. Change-Id: I743bd1f989b8fb3b7ba3e5cc8ce1bb44c00f99af --- docs/hooks.txt | 1 + includes/deferred/LinksUpdate.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/hooks.txt b/docs/hooks.txt index ae0770b07f..2bfeb66ef4 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -1974,6 +1974,7 @@ $insertions: an array of links to insert 'LinksUpdateComplete': At the end of LinksUpdate::doUpdate() when updating, including delete and insert, has completed for all link tables &$linksUpdate: the LinksUpdate object +$ticket: prior result of LBFactory::getEmptyTransactionTicket() 'LinksUpdateConstructed': At the end of LinksUpdate() is construction. &$linksUpdate: the LinksUpdate object diff --git a/includes/deferred/LinksUpdate.php b/includes/deferred/LinksUpdate.php index d18349b1db..895430414d 100644 --- a/includes/deferred/LinksUpdate.php +++ b/includes/deferred/LinksUpdate.php @@ -176,7 +176,7 @@ class LinksUpdate extends DataUpdate implements EnqueueableDataUpdate { // Run post-commit hooks without DBO_TRX $this->getDB()->onTransactionIdle( function () { - Hooks::run( 'LinksUpdateComplete', [ &$this ] ); + Hooks::run( 'LinksUpdateComplete', [ &$this, $this->ticket ] ); }, __METHOD__ ); -- 2.20.1