Skip to content

Commit

Permalink
fix(eda): issue with timeout and session
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmmatos committed Sep 1, 2024
1 parent 9961cc6 commit 42588ce
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions extensions/eda/plugins/event_source/eventstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ def __init__(
"""
logger.info("Initializing Stream: %s", stream_name)
self.client: AIOFalconAPI = client
self.session: aiohttp.ClientSession = client.session
self.stream_name: str = stream_name
self.data_feed: str = stream["dataFeedURL"]
self.token: str = stream["sessionToken"]["token"]
self.token_expires: str = stream["sessionToken"]["expiration"]
self.refresh_url: str = stream["refreshActiveSessionURL"]
self.partition: str = re.findall(r"v1/(\d+)", self.refresh_url)[0]
self.offset: int = offset
Expand Down Expand Up @@ -335,11 +335,10 @@ async def open_stream(self: "Stream") -> aiohttp.ClientResponse:
"Authorization": f"Token {self.token}",
},
"raise_for_status": True,
"timeout": aiohttp.ClientTimeout(total=float(self.refresh_interval) + 30),
"timeout": aiohttp.ClientTimeout(total=None),
}

session = aiohttp.ClientSession()
self.spigot: aiohttp.ClientResponse = await session.get(**kwargs)
self.spigot: aiohttp.ClientResponse = await self.session.get(**kwargs)
logger.info(
"Successfully opened stream %s:%s",
self.stream_name,
Expand Down

0 comments on commit 42588ce

Please sign in to comment.