diff --git a/backend/onyx/connectors/fireflies/connector.py b/backend/onyx/connectors/fireflies/connector.py index 7fda1bec36..31db6a62d1 100644 --- a/backend/onyx/connectors/fireflies/connector.py +++ b/backend/onyx/connectors/fireflies/connector.py @@ -45,6 +45,8 @@ _FIREFLIES_API_QUERY = """ } """ +ONE_MINUTE = 60 + def _create_doc_from_transcript(transcript: dict) -> Document | None: sections: List[TextSection] = [] @@ -106,6 +108,8 @@ def _create_doc_from_transcript(transcript: dict) -> Document | None: ) +# If not all transcripts are being indexed, try using a more-recently-generated +# API key. class FirefliesConnector(PollConnector, LoadConnector): def __init__(self, batch_size: int = INDEX_BATCH_SIZE) -> None: self.batch_size = batch_size @@ -191,6 +195,9 @@ class FirefliesConnector(PollConnector, LoadConnector): def poll_source( self, start: SecondsSinceUnixEpoch, end: SecondsSinceUnixEpoch ) -> GenerateDocumentsOutput: + # add some leeway to account for any timezone funkiness and/or bad handling + # of start time on the Fireflies side + start = max(0, start - ONE_MINUTE) start_datetime = datetime.fromtimestamp(start, tz=timezone.utc).strftime( "%Y-%m-%dT%H:%M:%S.000Z" )