diff --git a/MP1/scripts/run_mp.sh b/MP1/scripts/run_mp.sh index 1f9f558..9bae152 100755 --- a/MP1/scripts/run_mp.sh +++ b/MP1/scripts/run_mp.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -CMD='cd fa26_cs425_.group-mp_.team-01/MP1 && nohup python3 server.py /dev/null 2>&1 &' +CMD='cd /home/asing271/fa26_cs425_.group-mp_.team-01/MP1 && nohup python3 server.py /dev/null 2>&1 &' if [[ "$#" -eq 0 ]]; then echo "Need at least one server number as an argument." diff --git a/MP2/peer.py b/MP2/peer.py index 99d6b8b..ee73d52 100644 --- a/MP2/peer.py +++ b/MP2/peer.py @@ -15,13 +15,19 @@ def _machine_index(): return None log_file = open(f"machine.{_machine_index()}.log", "w") +log_file_mp1 = open(f"/home/asing271/fa26_cs425_.group-mp_.team-01/MP1/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() + log_file_mp1.write(f"[{timestamp}] {message}\n") + log_file_mp1.flush() + def utc_time(): return datetime.now(timezone.utc).timestamp()