Skip to content

Commit

Permalink
fix: print message before sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
yihong0618 committed Mar 10, 2023
1 parent f566fea commit cf44a19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion book_maker/translator/chatgptapi_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def translate(self, text):
# 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)

Expand Down

0 comments on commit cf44a19

Please sign in to comment.