mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix uptime negative time error by saving it as UTC from the start.
This commit is contained in:
@ -130,8 +130,8 @@ class Server:
|
||||
self.process = pexpect.spawn(self.server_command, cwd=self.server_path, timeout=None, encoding=None)
|
||||
self.is_crashed = False
|
||||
|
||||
ts = time.time()
|
||||
self.start_time = str(datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))
|
||||
# see https://docs.python.org/3/library/datetime.html#datetime.datetime.now
|
||||
self.start_time = str(datetime.datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S'))
|
||||
|
||||
if psutil.pid_exists(self.process.pid):
|
||||
self.PID = self.process.pid
|
||||
|
Reference in New Issue
Block a user