Skip to content

Commit

Permalink
Only add longpoll timeout to request timeout when longpoll is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
sander1988 committed May 30, 2024
1 parent f5e6801 commit bb47284
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyIndego/indego_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ async def update_state(self, force=False, longpoll=False, longpoll_timeout=120):
if force:
path = f"{path}%sforceRefresh=true" % ("&" if longpoll else "?")

self._update_state(await self.get(path, timeout=longpoll_timeout + 10))
self._update_state(await self.get(path, timeout=(longpoll_timeout + 10) if longpoll else 10))

async def get_state(self, force=False, longpoll=False, longpoll_timeout=120):
"""Update state and return it.
Expand Down
2 changes: 1 addition & 1 deletion pyIndego/indego_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def update_state(self, force=False, longpoll=False, longpoll_timeout=120):
else:
path = f"{path}?forceRefresh=true"

self._update_state(self.get(path, timeout=longpoll_timeout + 30))
self._update_state(self.get(path, timeout=(longpoll_timeout + 10) if longpoll else 10))

def get_state(self, force=False, longpoll=False, longpoll_timeout=120):
"""Update state. Can be both forced and with longpoll.
Expand Down

0 comments on commit bb47284

Please sign in to comment.