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.
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;
/**
*/
public function finalize() {
SearchIndexManager::getInstance()->commitBulkOperation();
+ UserStorageHandler::getInstance()->shutdown();
}
}