Commit 66f4e83c authored by ibuler's avatar ibuler

[Bugfix] 修改获取recorder配置的api

parent 680816ab
...@@ -136,6 +136,7 @@ class Server: ...@@ -136,6 +136,7 @@ class Server:
def close(self): def close(self):
logger.info("Closed server {}".format(self)) logger.info("Closed server {}".format(self))
self.send(b'')
self.chan.close() self.chan.close()
self.stop_evt.set() self.stop_evt.set()
self.chan.close() self.chan.close()
......
...@@ -270,7 +270,7 @@ class S3ReplayRecorder(ServerReplayRecorder): ...@@ -270,7 +270,7 @@ class S3ReplayRecorder(ServerReplayRecorder):
def get_command_recorder_class(config): def get_command_recorder_class(config):
command_storage = config["COMMAND_STORAGE"] command_storage = config["COMMAND_STORAGE"]
if command_storage['TYPE'] == "elasticsearch": if command_storage.get('TYPE') == "elasticsearch":
return ESCommandRecorder return ESCommandRecorder
else: else:
return ServerCommandRecorder return ServerCommandRecorder
...@@ -278,7 +278,7 @@ def get_command_recorder_class(config): ...@@ -278,7 +278,7 @@ def get_command_recorder_class(config):
def get_replay_recorder_class(config): def get_replay_recorder_class(config):
replay_storage = config["REPLAY_STORAGE"] replay_storage = config["REPLAY_STORAGE"]
if replay_storage['TYPE'] == "s3": if replay_storage.get('TYPE') == "s3":
return S3ReplayRecorder return S3ReplayRecorder
else: else:
return ServerReplayRecorder return ServerReplayRecorder
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