Skip to content

Commit

Permalink
BF: Increase send queue timeout (or all tests fail)
Browse files Browse the repository at this point in the history
  • Loading branch information
Debilski committed Jul 1, 2024
1 parent 72da467 commit dd9e98a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pelita/scripts/pelita_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

DEFAULT_MAX_CONNECTIONS = 50

# TODO: This timeout should be shorter
# once a connection has been established
SEND_QUEUE_TIMEOUT = 5. # seconds

@dataclass
class GameInfo:
round: Optional[int]
Expand Down Expand Up @@ -186,7 +190,7 @@ def handle_send_queue(self):
while True:
data = self.send_queue.get(block=False)
time_monotonic, dealer_id, message = data
if time.monotonic() - time_monotonic > 1:
if time.monotonic() - time_monotonic > SEND_QUEUE_TIMEOUT:
# discard
_logger.warning(f"Could not send to dealer id {dealer_id.hex()}.")
continue
Expand Down

0 comments on commit dd9e98a

Please sign in to comment.