Skip to content

Commit b56de85

Browse files
committed
Fix a test issue, restore some lost code
1 parent 647fa4a commit b56de85

File tree

8 files changed

+163
-472
lines changed

8 files changed

+163
-472
lines changed

agent_memory_server/dependencies.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,23 @@ async def add_task(
1919
"""Run tasks either directly or through Docket"""
2020
from docket import Docket
2121

22+
from agent_memory_server.utils.redis import get_redis_conn
23+
2224
logger.info("Adding task to background tasks...")
2325

2426
if settings.use_docket:
2527
logger.info("Scheduling task through Docket")
26-
logger.info("redis_url: %s", settings.redis_url)
28+
# Get the Redis connection that's already configured (will use testcontainer in tests)
29+
redis_conn = await get_redis_conn()
30+
# Use the connection's URL instead of settings.redis_url directly
31+
redis_url = redis_conn.connection_pool.connection_kwargs.get(
32+
"url", settings.redis_url
33+
)
34+
logger.info("redis_url: %s", redis_url)
2735
logger.info("docket_name: %s", settings.docket_name)
2836
async with Docket(
2937
name=settings.docket_name,
30-
url=settings.redis_url,
38+
url=redis_url,
3139
) as docket:
3240
# Schedule task through Docket
3341
await docket.add(func)(*args, **kwargs)

0 commit comments

Comments
 (0)