nas-tools/app/utils/cache_manager.py
2023-02-13 12:52:00 +08:00

15 lines
344 B
Python

# -*- coding: utf-8 -*-
import time
from cacheout import CacheManager, LRUCache, Cache
CACHES = {
"tmdb_supply": {'maxsize': 200}
}
cacheman = CacheManager(CACHES, cache_class=LRUCache)
TokenCache = Cache(maxsize=256, ttl=4*3600, timer=time.time, default=None)
ConfigLoadCache = Cache(maxsize=1, ttl=10, timer=time.time, default=None)