From b8d5952b83e7601c5df646efd976879f0dbd30c2 Mon Sep 17 00:00:00 2001 From: Tom van der Lee Date: Tue, 28 Apr 2026 10:45:41 +0200 Subject: Fixed issue with the redis proxy queue not working due to enqueing on the wrong queue --- ttun_server/redis.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'ttun_server/redis.py') diff --git a/ttun_server/redis.py b/ttun_server/redis.py index 18fbca2..fb9ff81 100644 --- a/ttun_server/redis.py +++ b/ttun_server/redis.py @@ -1,19 +1,13 @@ -import asyncio import os -from asyncio import get_running_loop from redis.asyncio import ConnectionPool, Redis class RedisConnectionPool: - instance: 'RedisConnectionPool' = None - - def __init__(self): - self.pool = ConnectionPool.from_url(os.environ.get('REDIS_URL')) + _pool: ConnectionPool | None = None @classmethod def get_connection(cls) -> Redis: - if cls.instance is None: - cls.instance = RedisConnectionPool() - - return Redis(connection_pool=cls.instance.pool) + if cls._pool is None: + cls._pool = ConnectionPool.from_url(os.environ.get('REDIS_URL')) + return Redis(connection_pool=cls._pool) \ No newline at end of file -- cgit v1.2.3