Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix sync user from ldap in cli mode consumes ram
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Apr 12, 2017
1 parent c9cbf45 commit 30b0a07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/src/core/src/pydio/Core/Services/ApplicationState.php
Expand Up @@ -47,6 +47,11 @@ class ApplicationState
*/
private static $minisiteHash = null;

/**
* @var bool
*/
public static $silenceInstantMessages = false;

/**
* @param string $restBase
*/
Expand Down
4 changes: 3 additions & 1 deletion core/src/core/src/pydio/Core/Services/UsersService.php
Expand Up @@ -127,7 +127,9 @@ public static function updateUser($userObject, $scope = "user"){
CacheService::save(AJXP_CACHE_SERVICE_NS_SHARED, "pydio:user:" . $userId, $userObject);
}else{
CacheService::saveWithTimestamp(AJXP_CACHE_SERVICE_NS_SHARED, "pydio:user:" . $userId, $userObject);
Controller::applyHook("msg.instant", array(Context::contextWithObjects($userObject, null), ReloadRepoListMessage::XML(), $userObject->getId()));
if(!ApplicationState::$silenceInstantMessages) {
Controller::applyHook("msg.instant", array(Context::contextWithObjects($userObject, null), ReloadRepoListMessage::XML(), $userObject->getId()));
}
}
}

Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/access.ajxp_conf/src/UsersManager.php
Expand Up @@ -602,6 +602,7 @@ public function usersActions(ServerRequestInterface $requestInterface, ResponseI
// Action for updating all Pydio's user from ldap in CLI mode
if((php_sapi_name() == "cli")){
// TODO : UPGRADE THIS TO NEW CLI FORMAT
ApplicationState::$silenceInstantMessages = true;
$progressBar = new ProgressBarCLI();
$countCallback = array($progressBar, "init");
$loopCallback = array($progressBar, "update");
Expand Down

0 comments on commit 30b0a07

Please sign in to comment.