Optimize and enable cache validation on Keycloak library
@zsinnema ci sta già lavorando.
Dal 8/3/2022.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Currently the Keycloak library of Cloud Harness uses the cachetool cached decorator to cache some frequently called functions.
For some applications that want to read the latest data from Keycloak this library should support cache invalidation or pass through options
With the cachetools library we could implement a "invalidate cache" function
see https://cachetools.readthedocs.io/en/latest/#cachetools.cached
from cachetools import cached, TTLCache
from threading import Lock
# since we are using one cache, make it big enough (512K should be enough)
cache = TTLCache(maxsize=512*1024, getsizeof=len)
lock = Lock()
@cached(cache, ttl=30, lock=lock)
def some_func_to_get_data_from_keycloak(params):
#
return some result
# invalidate / clear cache
def clear_cache():
with lock:
cache.clear()
- Lingua principale
- Python
- Stelle
- 19
- Fork
- 5
- Merge medio
- 3g 18h
- PR unite (30g)
- 3
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MetaCell/cloud-harness
-
new feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
MetaCell/cloud-harness#810 · 1 commento ·
-
When using a custom image for on_exit_notify of a workflow queue and payload should not be mandatory Apertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
MetaCell/cloud-harness#801 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
MetaCell/cloud-harness#781 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 32/100
MetaCell/cloud-harness#709 ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
MetaCell/cloud-harness#706 · 1 commento ·
Tutte le issue di MetaCell/cloud-harness
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·