Skip to content

Commit

Permalink
Add sleep between retries (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
yqiu24 authored Nov 15, 2023
1 parent dcb364a commit 284e30d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/github.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime
from time import sleep

from src import requests

Expand Down Expand Up @@ -388,6 +389,7 @@ def fetch_pull_requests(self, after_cursor: str = None):
except Exception as e:
print(e, data)
print(f"Could not get GraphQL result, retrying with count: {count}")
sleep(60/count)

if "data" not in data:
raise RuntimeError("Could not get pull request info from GraphQL after three tries")
Expand Down

0 comments on commit 284e30d

Please sign in to comment.