Add cache locks

This commit is contained in:
2022-08-20 23:52:10 +03:00
parent 2750436a5b
commit eb9cf2fe29
4 changed files with 185 additions and 90 deletions

View File

@@ -1,9 +1,12 @@
import aioredis
from app.services.cache_updater import (
check_books,
cache_file_by_book_id,
check_books_page,
)
from core.arq_pool import get_redis_settings, get_arq_pool
from core.config import env_config
from core.db import database
import core.sentry # noqa: F401
@@ -13,6 +16,9 @@ async def startup(ctx):
await database.connect()
ctx["arc_pool"] = await get_arq_pool()
ctx["redis"] = aioredis.Redis(
host=env_config.REDIS_HOST, port=env_config.REDIS_PORT, db=env_config.REDIS_DB
)
async def shutdown(ctx):