Commit changes to the user storage at worker end
authorAlexander Ebert <ebert@woltlab.com>
Wed, 9 May 2018 10:46:34 +0000 (12:46 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 9 May 2018 10:46:34 +0000 (12:46 +0200)
The `finalize()` method is invoked for every iteration on CLI and somewhat simulates the behavior of dedicated requests. Despite its name, `shutdown()` does not disable the user storage handler, it will simply save the changes and reset the internal storages in preparation for the next iteration.

wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php

index 29ddfcce5c4381de5ae701d1e9846fa07b9c7bf6..c1de85d0b6fc720a12163e22a026a39b94508308 100644 (file)
@@ -9,6 +9,7 @@ use wcf\system\exception\ParentClassException;
 use wcf\system\exception\SystemException;
 use wcf\system\request\LinkHandler;
 use wcf\system\search\SearchIndexManager;
+use wcf\system\user\storage\UserStorageHandler;
 use wcf\system\WCF;
 
 /**
@@ -175,5 +176,6 @@ abstract class AbstractRebuildDataWorker extends AbstractWorker implements IRebu
         */
        public function finalize() {
                SearchIndexManager::getInstance()->commitBulkOperation();
+               UserStorageHandler::getInstance()->shutdown();
        }
 }