Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14b5af36 authored by theronakpatel's avatar theronakpatel
Browse files

ecloud_accounts_realm_clients create distributed changes

parent 030d2d3e
Loading
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ class SSOService {
	private IUserManager $userManager;
	private TwoFactorMapper $twoFactorMapper;
	private ICacheFactory $cacheFactory;
	private ICache $clientsCache;

	private string $mainDomain;
	private string $legacyDomain;
@@ -62,7 +61,6 @@ class SSOService {
		$this->userManager = $userManager;
		$this->twoFactorMapper = $twoFactorMapper;
		$this->cacheFactory = $cacheFactory;
		$this->clientsCache = $this->cacheFactory->createDistributed('ecloud_accounts_sso_clients');

		$this->mainDomain = $this->config->getSystemValue("main_domain");
		$this->legacyDomain = $this->config->getSystemValue("legacy_domain");
@@ -158,7 +156,8 @@ class SSOService {
		$cacheKey = "{$clientsUrl}|no_params|no_keys";
		
		// Try to get cached clients
		$cachedClients = $this->clientsCache->get($cacheKey);
		$clientsCache = $this->cacheFactory->createDistributed('ecloud_accounts_realm_clients');
		$cachedClients = $clientsCache->get($cacheKey);
		if ($cachedClients !== null) {
			$this->logger->debug('Returning cached clients from distributed cache');
			return $cachedClients;
@@ -172,7 +171,7 @@ class SSOService {
				return [];
			}

			$this->clientsCache->set($cacheKey, $clients, self::CLIENTS_CACHE_TTL);
			$clientsCache->set($cacheKey, $clients, self::CLIENTS_CACHE_TTL);
			
			return $clients;
		} catch (\Exception $e) {