From f3f45d25f9f3448d0aeaa489a4a42c2675bc0d5c Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Wed, 20 Nov 2024 14:23:42 +0300 Subject: [PATCH] start --- app/main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index 9bbf810..14ca1da 100644 --- a/app/main.py +++ b/app/main.py @@ -26,7 +26,7 @@ def format_datetime(value, format="%d %B %Y, %H:%M:%S"): date = datetime.fromisoformat(value) return date.strftime(format) except Exception as e: - return date + return value statuses = { @@ -180,9 +180,9 @@ async def deal_tab( task_data_json = task_data.json() result = task_data_json["result"]["tasks"] - while len(task_data_json["result"]["tasks"]) == 50 or len(result) > 50*4: - limit = ((len(result)//50) + 1) * 50 - task_data = requests.get(get_task_hook + f"limit={limit}") + while len(task_data_json["result"]["tasks"]) == 50 and len(result) < 50*4: + limit = (len(result)//50) * 50 + task_data = requests.get(get_task_hook + f"&start={limit}") task_data_json = task_data.json() result += task_data_json["result"]["tasks"]