optimizations(?

This commit is contained in:
architect.in.git
2025-03-23 20:04:57 -06:00
parent b67637abe8
commit 85e15fb851
5 changed files with 289 additions and 248 deletions

View File

@@ -85,9 +85,6 @@ def store_task_status(task_id, status_data):
# Convert to JSON and store in Redis
redis_client.rpush(f"task:{task_id}:status", json.dumps(status_data))
# Trim the list to keep only the most recent 100 updates to avoid excessive memory usage
redis_client.ltrim(f"task:{task_id}:status", -100, -1)
# Set expiry for the list to avoid filling up Redis with old data
redis_client.expire(f"task:{task_id}:status", 60 * 60 * 24 * 7) # 7 days
redis_client.expire(f"task:{task_id}:status:next_id", 60 * 60 * 24 * 7) # 7 days