chore(release): 0.6.0 #14

Merged
pufereq merged 33 commits from release/0.6.0 into main 2026-03-05 19:59:05 +00:00
9 changed files with 278 additions and 91 deletions
Showing only changes of commit a9bace8aca - Show all commits

View File

@@ -6,7 +6,7 @@ import selectors
import socket import socket
import threading import threading
import time import time
from typing import TYPE_CHECKING, Any from typing import TYPE_CHECKING, Any, Final
import yaml import yaml
from judas_protocol import Category, ControlAction, Message from judas_protocol import Category, ControlAction, Message
@@ -21,6 +21,8 @@ if TYPE_CHECKING:
class BackendServer: class BackendServer:
ACK_TIMEOUT: Final[float] = 5.0 # seconds
def __init__(self, host: str = "0.0.0.0", port: int = 3692) -> None: def __init__(self, host: str = "0.0.0.0", port: int = 3692) -> None:
"""Initialize the backend server. """Initialize the backend server.
@@ -356,12 +358,13 @@ class BackendServer:
# check pending ACKs # check pending ACKs
for client, msg, timestamp in self.pending_acks[:]: for client, msg, timestamp in self.pending_acks[:]:
if time.time() - timestamp > 5: # 5 second timeout if time.time() - timestamp > self.ACK_TIMEOUT:
self.logger.warning( self.logger.warning(
f"ACK timeout for message {msg.id} to {client}, resending..." f"ACK timeout for message {msg.id} to {client}, resending..."
) )
self.send(client, msg) self.send(client, msg)
self.pending_acks.remove((client, msg, timestamp)) self.pending_acks.remove((client, msg, timestamp))
time.sleep(0.001) # prevent 100% CPU usage time.sleep(0.001) # prevent 100% CPU usage
except Exception as e: except Exception as e: