mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2026-03-03 15:10:48 +01:00
Add cache locks
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user