Skip to content

Commit

Permalink
tweak(TB User LdapAd) tweak backend retry behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmhh committed Sep 26, 2024
1 parent cf82079 commit 59325c0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tine20/Tinebase/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public static function factory($backendType)
if ((self::ACTIVEDIRECTORY === $backendType || self::LDAP === $backendType)
&& Tinebase_Config::getInstance()->{Tinebase_Config::USERBACKEND}->{Tinebase_Config::SYNCOPTIONS}->{Tinebase_Config::SYNC_USER_OF_GROUPS}
&& ($unavailableSince = Tinebase_Config::getInstance()->USERBACKEND_UNAVAILABLE_SINCE)) {
if (time() - $unavailableSince < 60) {
if (time() - $unavailableSince < 60 * 15) {
$backendType = self::SQL;
}
}
Expand Down Expand Up @@ -289,7 +289,10 @@ public static function factory($backendType)
}
} catch (Tinebase_Exception_Backend_Ldap $e) {
if (Tinebase_Config::getInstance()->{Tinebase_Config::USERBACKEND}->{Tinebase_Config::SYNCOPTIONS}->{Tinebase_Config::SYNC_USER_OF_GROUPS}) {
Tinebase_Config::getInstance()->USERBACKEND_UNAVAILABLE_SINCE = time();
Tinebase_Config::getInstance()->clearCache();
try {
Tinebase_Config::getInstance()->USERBACKEND_UNAVAILABLE_SINCE = time();
} catch (Exception) {}
return self::factory(self::SQL);
} else {
throw $e;
Expand Down

0 comments on commit 59325c0

Please sign in to comment.