Commit 2ffbfa17 authored by Mikhail Karnevskiy's avatar Mikhail Karnevskiy
Browse files

Fix streams info

parent 638c18de
Pipeline #5445 passed with stage
in 1 minute and 16 seconds
......@@ -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
......
......@@ -156,14 +156,6 @@ class Streamer:
self._handle_receiver_temporary_error()
self._handle_end_of_stream()
return None, None
except TemporaryError as err:
log.warn(format_error(err))
self._handle_receiver_temporary_error()
return None, None
except MissingDataError as err:
log.error("Missing data error", exc_info=True)
self._handle_receiver_missing_data_error()
return None, None
except StreamFinishedError as err:
log.info("Stream is finished")
self._handle_end_of_stream()
......@@ -173,6 +165,14 @@ class Streamer:
if self.end_of_stream_callback is None:
self.stop()
return None, None
except TemporaryError as err:
log.warn(format_error(err))
self._handle_receiver_temporary_error()
return None, None
except MissingDataError as err:
log.error("Missing data error", exc_info=True)
self._handle_receiver_missing_data_error()
return None, None
except Exception as err:
log.critical("Unhandled exception", exc_info=True)
self._handle_receiver_critical_error()
......
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