From 78f6d353e5186675f9854ca2412a7732ef975adf Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 21 Jun 2019 19:10:54 +0200 Subject: [PATCH] Add bulk processing parameter for UserActivityPointHandler::removeEvents() --- .../point/UserActivityPointHandler.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php b/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php index 474912e985..f54850d372 100644 --- a/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php @@ -151,11 +151,12 @@ class UserActivityPointHandler extends SingletonFactory { /** * Removes activity point events. * - * @param string $objectType - * @param integer[] $userToItems + * @param string $objectType + * @param integer[] $userToItems + * @param boolean $isBulkProcessing * @throws InvalidObjectTypeException */ - public function removeEvents($objectType, array $userToItems) { + public function removeEvents($objectType, array $userToItems, $isBulkProcessing = false) { if (empty($userToItems)) return; // get and validate object type @@ -180,9 +181,13 @@ class UserActivityPointHandler extends SingletonFactory { ]); } - // update total activity points per user - $userIDs = array_keys($userToItems); - $this->updateUsers($userIDs); + // during bulk processing, users do not have to be updated because + // they can be updated via `UserRebuildDataWorker` afterwards + // which calls `updateUsers()` + if (!$isBulkProcessing) { + // update total activity points per user + $this->updateUsers(array_keys($userToItems)); + } } /** -- 2.20.1