Skip to content

Commit 9f71f0a

Browse files
committed
fix: issues caused by no reading default use_redis from env
1 parent 35af8f6 commit 9f71f0a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/memos/mem_scheduler/schemas/general_schemas.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from pathlib import Path
24

35

@@ -21,7 +23,7 @@
2123
DEFAULT_MAX_INTERNAL_MESSAGE_QUEUE_SIZE = -1
2224
DEFAULT_TOP_K = 5
2325
DEFAULT_CONTEXT_WINDOW_SIZE = 5
24-
DEFAULT_USE_REDIS_QUEUE = True
26+
DEFAULT_USE_REDIS_QUEUE = os.getenv("MEMSCHEDULER_USE_REDIS_QUEUE", "False").lower() == "true"
2527
DEFAULT_MULTI_TASK_RUNNING_TIMEOUT = 30
2628
DEFAULT_SCHEDULER_RETRIEVER_BATCH_SIZE = 20
2729
DEFAULT_SCHEDULER_RETRIEVER_RETRIES = 1

src/memos/mem_scheduler/task_schedule_modules/redis_queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ def qsize(self) -> dict:
785785
Total number of messages across all matching streams.
786786
"""
787787
if not self._redis_conn:
788-
return 0
788+
return {}
789789

790790
total_size = 0
791791
try:

0 commit comments

Comments
 (0)