fix(run_agent_background): add delay for pending Redis operations before completion logging

This commit is contained in:
sharath 2025-06-02 20:42:38 +00:00
parent fc8a167510
commit b26f65203e
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -231,6 +231,9 @@ async def run_agent_background(
# Remove the instance-specific active run key # Remove the instance-specific active run key
await _cleanup_redis_instance_key(agent_run_id) await _cleanup_redis_instance_key(agent_run_id)
# Wait for 5 seconds for any pending redis operations to complete
await asyncio.sleep(5)
logger.info(f"Agent run background task fully completed for: {agent_run_id} (Instance: {instance_id}) with final status: {final_status}") logger.info(f"Agent run background task fully completed for: {agent_run_id} (Instance: {instance_id}) with final status: {final_status}")
async def _cleanup_redis_instance_key(agent_run_id: str): async def _cleanup_redis_instance_key(agent_run_id: str):