From 284e30dd4c01a0e17fa731e1d0277f15548eb24c Mon Sep 17 00:00:00 2001 From: Amy Qiu <115590499+yqiu24@users.noreply.github.com> Date: Wed, 15 Nov 2023 09:47:34 -0800 Subject: [PATCH] Add sleep between retries (#19) --- src/github.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/github.py b/src/github.py index 7444974..54d51d5 100644 --- a/src/github.py +++ b/src/github.py @@ -1,4 +1,5 @@ from datetime import datetime +from time import sleep from src import requests @@ -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")