Skip to content

Commit

Permalink
Offset Github by 3 hours to not lose updates (onyx-dot-app#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhongsun96 authored Feb 12, 2024
1 parent 1c4f7fe commit 1b55e61
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backend/danswer/connectors/github/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,17 @@ def poll_source(
) -> GenerateDocumentsOutput:
start_datetime = datetime.utcfromtimestamp(start)
end_datetime = datetime.utcfromtimestamp(end)
return self._fetch_from_github(start_datetime, end_datetime)

# Move start time back by 3 hours, since some Issues/PRs are getting dropped
# Could be due to delayed processing on GitHub side
# The non-updated issues since last poll will be shortcut-ed and not embedded
adjusted_start_datetime = start_datetime - timedelta(hours=3)

epoch = datetime.utcfromtimestamp(0)
if adjusted_start_datetime < epoch:
adjusted_start_datetime = epoch

return self._fetch_from_github(adjusted_start_datetime, end_datetime)


if __name__ == "__main__":
Expand Down

0 comments on commit 1b55e61

Please sign in to comment.