Skip to content

Commit

Permalink
reduce frequency and increase failure delay
Browse files Browse the repository at this point in the history
  • Loading branch information
AwkwardPeak7 committed Jul 27, 2024
1 parent 7a5cfe8 commit f77949c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
schedule:
- cron: '0 * * * *'
- cron: '0 0 */7 * *'

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions webnovel.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __request(self, path: str, payload: Optional[dict] = None) -> Response:
message += f"\nAttempt {attempt}/{self.__MAX_RETRIES}"

if sleep_time is not None:
message += f"\nRetrying in {sleep_time} seconds"
message += f"\nRetrying in {sleep_time} minutes"

self.__send_webhook(
content=f":warning: {message}",
Expand All @@ -80,7 +80,7 @@ def __request(self, path: str, payload: Optional[dict] = None) -> Response:
tqdm.write(message)

if sleep_time is not None:
time.sleep(sleep_time)
time.sleep(sleep_time*60)

message = f"Failed to get response after {self.__MAX_RETRIES} tries"
self.__send_webhook(f":warning::warning::warning: {message}")
Expand Down

0 comments on commit f77949c

Please sign in to comment.