Skip to content

Commit d033c8e

Browse files
committed
fix: truncate float timestamps for Slack conversations.history API
time.time() returns a float with decimal places which causes the Slack conversations.history API to return no messages. Truncating to int fixes the issue. Fixes #3032
1 parent df8379f commit d033c8e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/connectors_service/connectors/sources/slack/datasource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ async def get_docs(self, filtering=None):
9595
yield message, None
9696

9797
async def channels_and_messages(self):
98-
current_unix_timestamp = time.time()
99-
past_unix_timestamp = current_unix_timestamp - self.n_days_to_fetch * 24 * 3600
98+
current_unix_timestamp = int(time.time())
99+
past_unix_timestamp = int(current_unix_timestamp - self.n_days_to_fetch * 24 * 3600)
100100
async for channel in self.slack_client.list_channels(
101101
not self.auto_join_channels
102102
):

0 commit comments

Comments
 (0)