tum-esm / hermes

https://tenta-on-acropolis.fly.dev/
GNU Affero General Public License v3.0
9 stars 0 forks source link

Offline Detection Restart is missing the uptime info #187

Closed patrickjaigner closed 5 months ago

patrickjaigner commented 5 months ago

Every time the system restarts after detection of being offline for >24 hours, it keeps restarting until a new connection is present. This poses a danger to the OS and might be the reason of the broken pipe issue #184

Fix:

patrickjaigner commented 5 months ago

From terminal integration test

from datetime import datetime
import subprocess
import time

uptime = subprocess.check_output("uptime -s", shell=True)
uptime = uptime.decode("utf-8").strip()
uptime = datetime.strptime(uptime, "%Y-%m-%d %H:%M:%S")
uptime = time.time() - uptime.timestamp()

print(uptime)
patrickjaigner commented 5 months ago

Tested and integrated with 0.3.0-beta.2