refactor(playout): move daemon flag to thread class
This commit is contained in:
parent
d79cf00800
commit
64b3d164c9
|
@ -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)
|
||||
|
|
|
@ -34,6 +34,7 @@ signal.signal(signal.SIGTERM, shutdown_handler)
|
|||
|
||||
class PypoFetch(Thread):
|
||||
name = "fetch"
|
||||
daemon = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
|
@ -12,6 +12,7 @@ from requests.exceptions import ConnectionError, HTTPError, Timeout
|
|||
|
||||
class PypoFile(Thread):
|
||||
name = "file"
|
||||
daemon = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -22,6 +22,7 @@ signal.signal(signal.SIGTERM, shutdown_handler)
|
|||
|
||||
class PypoLiqQueue(Thread):
|
||||
name = "liquidsoap_queue"
|
||||
daemon = True
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue