From 97a9b0417106c4e3cfc11501c9408f15574daf23 Mon Sep 17 00:00:00 2001 From: karootplx Date: Fri, 15 Nov 2024 05:32:10 +0800 Subject: [PATCH] perf: extend delay --- commons/human_feedback/dojo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commons/human_feedback/dojo.py b/commons/human_feedback/dojo.py index bd3aca2..f049eb1 100644 --- a/commons/human_feedback/dojo.py +++ b/commons/human_feedback/dojo.py @@ -70,7 +70,7 @@ async def get_task_results_by_task_id(cls, task_id: str) -> List[Dict] | None: return task_results except Exception as e: if attempt < max_retries - 1: - delay = base_delay * 2**attempt + delay = base_delay * 2**attempt + random.uniform(0, 1) logger.warning( f"Error occurred while getting task results for task_id {task_id}: {e}. " f"Retrying in {delay:.2f} seconds..."