Commit f3c22dd5 authored by ibuler's avatar ibuler

[Feature] 上传录像完成

parent 94b942bb
......@@ -87,13 +87,16 @@ class Coco:
self.keep_heartbeat()
self.monitor_sessions()
def keep_heartbeat(self):
def func():
while not self.stop_evt.is_set():
def heartbeat(self):
_sessions = [s.to_json() for s in self.sessions]
tasks = self.service.terminal_heartbeat(_sessions)
if tasks:
self.handle_task(tasks)
def keep_heartbeat(self):
def func():
while not self.stop_evt.is_set():
self.heartbeat()
time.sleep(self.config["HEARTBEAT_INTERVAL"])
thread = threading.Thread(target=func)
......@@ -176,9 +179,11 @@ class Coco:
def add_session(self, session):
with self.lock:
self.sessions.append(session)
self.heartbeat()
def remove_session(self, session):
with self.lock:
self.sessions.remove(session)
self.heartbeat()
......@@ -117,11 +117,12 @@ class Server:
self._input = self._parse_input()
else:
if not self._in_input_state:
print("#" * 30 + " 新周期 " + "#" * 30)
self._output = self._parse_output()
print(self._input)
print(self._output)
print("#" * 30 + " End " + "#" * 30)
logger.debug("\n{}\nInput: {}\nOutput: {}\n{}".format(
"#" * 30 + " Command " + "#" * 30,
self._input, self._output,
"#" * 30 + " End " + "#" * 30,
))
self.command_queue.put((self._input, self._output))
del self.input_data[:]
del self.output_data[:]
......
......@@ -155,7 +155,7 @@ class ServerReplayRecorder(LocalFileReplayRecorder):
def push_replay_record(self, archive):
logger.debug("Start push replay record to server")
return self.app.service.push_session_replay(archive)
return self.app.service.push_session_replay(archive, str(self.session.id))
def push_records(self):
def func():
......
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