From: Matthias Schmidt Date: Fri, 21 Jun 2019 17:10:54 +0000 (+0200) Subject: Add bulk processing parameter for UserActivityPointHandler::removeEvents() X-Git-Tag: 5.2.0_Alpha_3~26^2~11 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=78f6d353e5186675f9854ca2412a7732ef975adf;p=GitHub%2FWoltLab%2FWCF.git Add bulk processing parameter for UserActivityPointHandler::removeEvents() --- 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)); + } } /**