Commit bdfe112c authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Merge branch 'fix/new_streams' into 'master'

Fix streams info

See merge request !28
parents 638c18de e63861c9
......@@ -71,7 +71,7 @@ class Application:
parser.add_argument(
"--stream_naming_scheme", type=str, default="numeric", choices=[
"numeric", "date", "basename"],
"numeric", "date", "basename", "basename_nonfinished"],
help="Scheme to chose new stream name")
parser.add_argument(
......
......@@ -112,7 +112,8 @@ class SimpleAsapoReceiver:
def get_stream_info(self):
try:
return self.consumer.get_stream_list(from_stream=self.stream)[0]
info = self.consumer.get_stream_list()
return next(x for x in info if x["name"] == self.stream)
except asapo_consumer.AsapoConsumerError as err:
raise StreamError("Failed to get stream info") from err
......
......@@ -18,6 +18,6 @@ class EndOfStreamError(TemporaryError):
pass
class StreamFinishedError(TemporaryError):
class StreamFinishedError(StreamError):
pass
......@@ -166,9 +166,9 @@ class Streamer:
return None, None
except StreamFinishedError as err:
log.info("Stream is finished")
self._handle_end_of_stream()
stream_info = self.receiver.get_stream_info()
self.worker.stream_finished(stream_info)
self._handle_end_of_stream()
# Stop this instance if it can not start new instance anymore
if self.end_of_stream_callback is None:
self.stop()
......
Supports Markdown
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