Merge pull request #12 from illinois-cs-coursework/aryan
M2 DONE FINALLY
This commit is contained in:
2 files changed
+7
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CMD='cd fa26_cs425_.group-mp_.team-01/MP1 && nohup python3 server.py </dev/null >/dev/null 2>&1 &'
|
||||
CMD='cd /home/asing271/fa26_cs425_.group-mp_.team-01/MP1 && nohup python3 server.py </dev/null >/dev/null 2>&1 &'
|
||||
|
||||
if [[ "$#" -eq 0 ]]; then
|
||||
echo "Need at least one server number as an argument."
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in new issue
Block a user