Skip to content

Commit ddd5fb1

Browse files
authored
Merge pull request #92 from buslicworldcup2000Brazil/fix/check-win-timeout
fix: remove hardcoded 60s timeout in check_win
2 parents 93df913 + b31b93a commit ddd5fb1

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

  • BinaryOptionsToolsV2/python/BinaryOptionsToolsV2/pocketoption

BinaryOptionsToolsV2/python/BinaryOptionsToolsV2/pocketoption/asynchronous.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,8 @@ async def check_win(self, id: str) -> dict:
332332
TimeoutError: If result check times out
333333
"""
334334

335-
# Set a reasonable timeout to prevent hanging
336-
timeout_seconds = 60 # Increased timeout to accommodate longer trade durations
337-
338-
try:
339-
# Use asyncio.wait_for as additional protection against hanging
340-
trade = await asyncio.wait_for(self._get_trade_result(id), timeout=timeout_seconds)
341-
return trade
342-
except asyncio.TimeoutError:
343-
raise TimeoutError(f"Timeout waiting for trade result for ID: {id}")
335+
# Let Rust handle the timeout based on the trade close timestamp.
336+
return await self._get_trade_result(id)
344337

345338
async def get_deal_end_time(self, trade_id: str) -> Optional[int]:
346339
"""

0 commit comments

Comments
 (0)