refactor(playout): move daemon flag to thread class

This commit is contained in:
jo 2022-09-08 17:55:51 +02:00 committed by Jonas L
parent d79cf00800
commit 64b3d164c9
6 changed files with 7 additions and 5 deletions

View File

@ -112,7 +112,6 @@ def cli(log_level: str, log_filepath: Optional[Path], config_filepath: Optional[
message_handler.start()
file_thread = PypoFile(file_queue, api_client)
file_thread.daemon = True
file_thread.start()
fetch_thread = PypoFetch(
@ -125,15 +124,12 @@ def cli(log_level: str, log_filepath: Optional[Path], config_filepath: Optional[
api_client,
legacy_client,
)
fetch_thread.daemon = True
fetch_thread.start()
push_thread = PypoPush(push_queue, pypo_liquidsoap, config)
push_thread.daemon = True
push_thread.start()
recorder_thread = Recorder(recorder_queue, config, legacy_client)
recorder_thread.daemon = True
recorder_thread.start()
stats_collector_thread = StatsCollectorThread(config, legacy_client)

View File

@ -34,6 +34,7 @@ signal.signal(signal.SIGTERM, shutdown_handler)
class PypoFetch(Thread):
name = "fetch"
daemon = True
def __init__(
self,

View File

@ -12,6 +12,7 @@ from requests.exceptions import ConnectionError, HTTPError, Timeout
class PypoFile(Thread):
name = "file"
daemon = True
def __init__(
self,

View File

@ -21,6 +21,7 @@ def is_file(media_item):
class PypoPush(Thread):
name = "push"
daemon = True
def __init__(
self,
@ -41,7 +42,6 @@ class PypoPush(Thread):
self.pypo_liquidsoap = pypo_liquidsoap
self.plq = PypoLiqQueue(self.future_scheduled_queue, self.pypo_liquidsoap)
self.plq.daemon = True
self.plq.start()
def main(self):

View File

@ -22,6 +22,7 @@ signal.signal(signal.SIGTERM, shutdown_handler)
class PypoLiqQueue(Thread):
name = "liquidsoap_queue"
daemon = True
def __init__(
self,

View File

@ -173,6 +173,9 @@ class ShowRecorder(Thread):
class Recorder(Thread):
name = "recorder"
daemon = True
def __init__(self, q, config: Config, legacy_client: LegacyClient):
Thread.__init__(self)
self.legacy_client = legacy_client