Skip to content

Commit 50d117d

Browse files
authored
Merge pull request #8061 from DIRACGridBot/cherry-pick-2-979b75ee3-integration
[sweep:integration] cache getProxyPrrovidersForDN
2 parents 5d3f8d4 + 390ce95 commit 50d117d

File tree

1 file changed

+10
-0
lines changed
  • src/DIRAC/ConfigurationSystem/Client/Helpers

1 file changed

+10
-0
lines changed

src/DIRAC/ConfigurationSystem/Client/Helpers/Registry.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
""" Helper for /Registry section
22
"""
3+
34
import errno
45

6+
from threading import Lock
7+
8+
from cachetools import TTLCache, cached
9+
10+
511
from DIRAC import S_OK, S_ERROR
612
from DIRAC.ConfigurationSystem.Client.Config import gConfig
713
from DIRAC.ConfigurationSystem.Client.Helpers.CSGlobals import getVO
@@ -628,6 +634,10 @@ def getDNProperty(userDN, value, defaultValue=None):
628634
return S_OK(defaultValue)
629635

630636

637+
_cache_getProxyProvidersForDN = TTLCache(maxsize=1000, ttl=60)
638+
639+
640+
@cached(_cache_getProxyProvidersForDN, lock=Lock())
631641
def getProxyProvidersForDN(userDN):
632642
"""Get proxy providers by user DN
633643

0 commit comments

Comments
 (0)