core/services/memorycache.py
2024-03-12 17:26:52 +03:00

12 lines
306 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from dogpile.cache import make_region
from settings import REDIS_URL
# Создание региона кэша с TTL
cache_region = make_region()
cache_region.configure(
'dogpile.cache.redis',
arguments={'url': f'{REDIS_URL}/1'},
expiration_time=3600, # Cache expiration time in seconds
)