This commit is contained in:
parent
d4548f71c7
commit
09a6d085fd
3
cache/revalidator.py
vendored
3
cache/revalidator.py
vendored
|
@ -1,6 +1,7 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from cache.cache import cache_author, cache_topic, get_cached_author, get_cached_topic
|
from cache.cache import cache_author, cache_topic, get_cached_author, get_cached_topic
|
||||||
|
from resolvers.stat import get_with_stat
|
||||||
from utils.logger import root_logger as logger
|
from utils.logger import root_logger as logger
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ class CacheRevalidationManager:
|
||||||
async with self.lock:
|
async with self.lock:
|
||||||
# Ревалидация кэша авторов
|
# Ревалидация кэша авторов
|
||||||
for author_id in self.items_to_revalidate["authors"]:
|
for author_id in self.items_to_revalidate["authors"]:
|
||||||
author = await get_cached_author(author_id)
|
author = await get_cached_author(author_id, get_with_stat)
|
||||||
if author:
|
if author:
|
||||||
await cache_author(author)
|
await cache_author(author)
|
||||||
self.items_to_revalidate["authors"].clear()
|
self.items_to_revalidate["authors"].clear()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user