From cf44a19d82e324ccf48f5c3e2c7ef9c4d5b22f83 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Fri, 10 Mar 2023 20:54:07 +0800 Subject: [PATCH] fix: print message before sleep --- book_maker/translator/chatgptapi_translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book_maker/translator/chatgptapi_translator.py b/book_maker/translator/chatgptapi_translator.py index 7557cf9..dfdfdbc 100644 --- a/book_maker/translator/chatgptapi_translator.py +++ b/book_maker/translator/chatgptapi_translator.py @@ -47,8 +47,8 @@ class ChatGPTAPI(Base): # 2. an apikey has no money or reach limit, don’t sleep, just replace it with another apikey # 3. all apikey reach limit, then use current sleep sleep_time = int(60 / self.key_len) + print(e, f"will sleep {sleep_time} seconds") time.sleep(sleep_time) - print(e, f"will sleep {sleep_time} seconds") t_text = self.get_translation(text)