test(playout): silence existing broad-exception-caught errors
This commit is contained in:
parent
a77321190f
commit
b17ff4afad
|
@ -153,6 +153,6 @@ class StatsCollectorThread(Thread):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
self._collector.collect(self._config.stream.outputs.merged)
|
self._collector.collect(self._config.stream.outputs.merged)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
sleep(120)
|
sleep(120)
|
||||||
|
|
|
@ -60,7 +60,7 @@ class MessageHandler(ConsumerMixin):
|
||||||
else:
|
else:
|
||||||
logger.warning("invalid command: %s", command)
|
logger.warning("invalid command: %s", command)
|
||||||
|
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
|
|
||||||
message.ack()
|
message.ack()
|
||||||
|
|
|
@ -119,7 +119,7 @@ class PypoFetch(Thread):
|
||||||
0,
|
0,
|
||||||
)
|
)
|
||||||
logger.info("New timeout: %s", self.listener_timeout)
|
logger.info("New timeout: %s", self.listener_timeout)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
|
|
||||||
# Initialize Liquidsoap environment
|
# Initialize Liquidsoap environment
|
||||||
|
@ -226,7 +226,7 @@ class PypoFetch(Thread):
|
||||||
all_events[key] = item
|
all_events[key] = item
|
||||||
|
|
||||||
self.media_prepare_queue.put(copy.copy(file_events))
|
self.media_prepare_queue.put(copy.copy(file_events))
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
|
|
||||||
# Send the data to pypo-push
|
# Send the data to pypo-push
|
||||||
|
@ -236,7 +236,7 @@ class PypoFetch(Thread):
|
||||||
# cleanup
|
# cleanup
|
||||||
try:
|
try:
|
||||||
self.cache_cleanup(events)
|
self.cache_cleanup(events)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
|
|
||||||
# do basic validation of file parameters. Useful for debugging
|
# do basic validation of file parameters. Useful for debugging
|
||||||
|
@ -295,7 +295,7 @@ class PypoFetch(Thread):
|
||||||
logger.info("File '%s' removed", expired_filepath)
|
logger.info("File '%s' removed", expired_filepath)
|
||||||
else:
|
else:
|
||||||
logger.info("File '%s' not removed. Still busy!", expired_filepath)
|
logger.info("File '%s' not removed. Still busy!", expired_filepath)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(
|
logger.exception(
|
||||||
"Problem removing file '%s': %s", expired_file, exception
|
"Problem removing file '%s': %s", expired_file, exception
|
||||||
)
|
)
|
||||||
|
@ -306,7 +306,7 @@ class PypoFetch(Thread):
|
||||||
logger.debug("Received event from API client: %s", self.schedule_data)
|
logger.debug("Received event from API client: %s", self.schedule_data)
|
||||||
self.process_schedule(self.schedule_data)
|
self.process_schedule(self.schedule_data)
|
||||||
return True
|
return True
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception("Unable to fetch schedule: %s", exception)
|
logger.exception("Unable to fetch schedule: %s", exception)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -371,13 +371,13 @@ class PypoFetch(Thread):
|
||||||
except Empty:
|
except Empty:
|
||||||
logger.info("Queue timeout. Fetching schedule manually")
|
logger.info("Queue timeout. Fetching schedule manually")
|
||||||
manual_fetch_needed = True
|
manual_fetch_needed = True
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if manual_fetch_needed:
|
if manual_fetch_needed:
|
||||||
self.persistent_manual_schedule_fetch(max_attempts=5)
|
self.persistent_manual_schedule_fetch(max_attempts=5)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception("Failed to manually fetch the schedule: %s", exception)
|
logger.exception("Failed to manually fetch the schedule: %s", exception)
|
||||||
|
|
||||||
loops += 1
|
loops += 1
|
||||||
|
|
|
@ -44,7 +44,7 @@ class PypoFile(Thread):
|
||||||
dst_size = os.path.getsize(dst)
|
dst_size = os.path.getsize(dst)
|
||||||
if dst_size == 0:
|
if dst_size == 0:
|
||||||
dst_exists = False
|
dst_exists = False
|
||||||
except Exception:
|
except Exception: # pylint: disable=broad-exception-caught
|
||||||
dst_exists = False
|
dst_exists = False
|
||||||
|
|
||||||
do_copy = False
|
do_copy = False
|
||||||
|
@ -86,7 +86,7 @@ class PypoFile(Thread):
|
||||||
file_event["filesize"] = file_size
|
file_event["filesize"] = file_size
|
||||||
|
|
||||||
file_event["file_ready"] = True
|
file_event["file_ready"] = True
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(
|
logger.exception(
|
||||||
"could not copy file %s to %s: %s",
|
"could not copy file %s to %s: %s",
|
||||||
file_id,
|
file_id,
|
||||||
|
@ -123,7 +123,7 @@ class PypoFile(Thread):
|
||||||
)
|
)
|
||||||
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
|
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
|
||||||
logger.exception(error_msg)
|
logger.exception(error_msg)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception("%s: %s", error_msg, exception)
|
logger.exception("%s: %s", error_msg, exception)
|
||||||
|
|
||||||
return file_size
|
return file_size
|
||||||
|
@ -179,7 +179,7 @@ class PypoFile(Thread):
|
||||||
file_event = self.get_highest_priority_file_event(self.file_events)
|
file_event = self.get_highest_priority_file_event(self.file_events)
|
||||||
if file_event is not None:
|
if file_event is not None:
|
||||||
self.copy_file(file_event)
|
self.copy_file(file_event)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
raise exception
|
raise exception
|
||||||
|
|
||||||
|
@ -189,7 +189,7 @@ class PypoFile(Thread):
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
self.main()
|
self.main()
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ class PypoPush(Thread):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
events = self.queue.get(block=True)
|
events = self.queue.get(block=True)
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
raise exception
|
raise exception
|
||||||
|
|
||||||
|
@ -103,6 +103,6 @@ class PypoPush(Thread):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
self.main()
|
self.main()
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
|
@ -74,5 +74,5 @@ class PypoLiqQueue(Thread):
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
self.main()
|
self.main()
|
||||||
except Exception as exception:
|
except Exception as exception: # pylint: disable=broad-exception-caught
|
||||||
logger.exception(exception)
|
logger.exception(exception)
|
||||||
|
|
Loading…
Reference in New Issue