fixed a bug where all remote sessions where saved, even not connected ones....

fixed a bug where all remote sessions where saved, even not connected ones. this in some circumstances to an error while switching the caffe-versions on the remote host.
parent e954a7da
......@@ -72,17 +72,17 @@ class ServerTransaction(Transaction):
def restart(self):
"""Saves all server-sessions of the current project and restarts the host afterwards."""
msg = self.asyncRead()
if msg:
if msg and "pid" in msg:
path = msg["pid"]
if "pid" in msg:
sessionsUIDs = self.parent.sessionManager.findSessionIDsByProjectId(msg["pid"])
success = True
for uid in sessionsUIDs:
session = self.parent.sessionManager.findSessionBySessionUid(uid)
if not session.save():
success = False
if session.isConnected:
if not session.save():
success = False
if success is False:
msg["error"] = ["Could not save a session because it contains layer of a other caffe-version."]
msg["error"] = ["Could not save a session because it contains layer of another caffe-version."]
msg["status"] = False
self.send(msg)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment