Skip to content

Commit

Permalink
feat: fix sse endpoint for dashboard
Browse files Browse the repository at this point in the history
Signed-off-by: Han Xiao <han.xiao@jina.ai>
  • Loading branch information
hanxiao committed Apr 8, 2020
1 parent 6dbc2e7 commit 834760f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions jina/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def from_yaml(cls, constructor, node):
"""Required by :mod:`ruamel.yaml.constructor` """
return cls._get_instance_from_yaml(constructor, node)[0]

def save_config(self, filename: str = None) -> str:
def save_config(self, filename: str = None) -> bool:
"""
Serialize the object to a yaml file
Expand All @@ -152,6 +152,10 @@ def save_config(self, filename: str = None) -> str:
with open(f, 'w', encoding='utf8') as fp:
yaml.dump(self, fp)
self.logger.info(f'{self}\'s yaml config is save to %s' % f)
return True

def _get_yaml_config(self):
yaml.register_class(Flow)
stream = StringIO()
yaml.dump(self, stream)
return stream.getvalue().strip()
Expand Down Expand Up @@ -441,7 +445,7 @@ def start(self):
self.args.port_sse,
self.args.log_endpoint,
self.args.yaml_endpoint,
self.save_config()))
''))
self.sse_logger.start()
time.sleep(1)

Expand Down

0 comments on commit 834760f

Please sign in to comment.