File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
backend/onyx/connectors/github Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 44
44
45
45
_MAX_NUM_RATE_LIMIT_RETRIES = 5
46
46
47
+ ONE_DAY = timedelta (days = 1 )
48
+
47
49
48
50
def _sleep_after_rate_limit_exception (github_client : Github ) -> None :
49
51
sleep_time = github_client .get_rate_limit ().core .reset .replace (
@@ -628,6 +630,8 @@ def _fetch_from_github(
628
630
headers = next_repo .raw_headers ,
629
631
raw_data = next_repo .raw_data ,
630
632
)
633
+ checkpoint .stage = GithubConnectorStage .PRS
634
+ checkpoint .reset ()
631
635
632
636
logger .info (f"{ len (checkpoint .cached_repo_ids )} repos remaining" )
633
637
@@ -641,7 +645,8 @@ def load_from_checkpoint(
641
645
checkpoint : GithubConnectorCheckpoint ,
642
646
) -> CheckpointOutput [GithubConnectorCheckpoint ]:
643
647
start_datetime = datetime .fromtimestamp (start , tz = timezone .utc )
644
- end_datetime = datetime .fromtimestamp (end , tz = timezone .utc )
648
+ # add a day for timezone safety
649
+ end_datetime = datetime .fromtimestamp (end , tz = timezone .utc ) + ONE_DAY
645
650
646
651
# Move start time back by 3 hours, since some Issues/PRs are getting dropped
647
652
# Could be due to delayed processing on GitHub side
You can’t perform that action at this time.
0 commit comments