Update peer.py

This commit is contained in:
Aryan Singh committed 2026-09-27 20:20:36 -05:00
1 parent 4dbe907e1f
commit 36cc7825b3
1 file changed
+5 -6
+5 -6
View File
@@ -14,12 +14,11 @@ def _machine_index():
return int(idx)
return None
log_file = open(f"machine.{_machine_index()}.log", "a")
log_file = open(f"machine.{_machine_index()}.log", "w")
log_lock = threading.Lock()
def log(message):
timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
with log_lock:
print(f"[{timestamp}] {message}")
log_file.write(f"[{timestamp}] {message}\n")
log_file.flush()
@@ -32,13 +31,13 @@ GLOBAL_PORT = 8989
MY_IP = socket.gethostbyname(socket.gethostname())
HEARTBEAT_INTERVAL = 0.25
GOSSIP_INTERVAL = 0.15
GOSSIP_INTERVAL = 0.35
JOIN_RETRY_INTERVAL = 1.0
GOSSIP_FANOUT = 1
GOSSIP_FANOUT = 2
GOSSIP_FAILURE_TIMEOUT = 2.8
GOSSIP_S_SUSPECT_TIMEOUT = 1
GOSSIP_S_TIMEOUT_SUSPECT = 1.8
GOSSIP_S_SUSPECT_TIMEOUT = 1.2
GOSSIP_S_TIMEOUT_SUSPECT = 1.6
GOSSIP_FAILURE_TIMEOUT_CLEANUP = 10.0