Skip to content

Commit

Permalink
fix: fix teamwork cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
daxartio committed Jun 2, 2024
1 parent de16f00 commit 3b1a5b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sportorg/modules/teamwork/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, in_queue: queue.Queue):
def __call__(self, conn: socket.socket) -> None:
try:
while True:
cmd = self._in_queue.get_nowait()
cmd = self._in_queue.get(timeout=0.1)
conn.sendall(cmd.get_packet())
except queue.Empty:
return
Expand Down
2 changes: 1 addition & 1 deletion sportorg/modules/teamwork/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __init__(self, selector: selectors.BaseSelector, in_queue: Queue, logger):
def __call__(self, socks: List[socket.socket]) -> None:
try:
while True:
command = self._in_queue.get_nowait()
command = self._in_queue.get(timeout=0.1)
for sock in socks:
if command.is_sender(sock):
continue
Expand Down

0 comments on commit 3b1a5b5

Please sign in to comment.