CC-5227 - Sometimes Liquidsoap telnet is unresponsive which causes all Pypo threads to block
-restart Liquidsoap if communication fails..
This commit is contained in:
parent
f164cf0ad4
commit
21c84dcaad
|
@ -40,9 +40,13 @@ signal.signal(signal.SIGINT, keyboardInterruptHandler)
|
||||||
POLL_INTERVAL = 1800
|
POLL_INTERVAL = 1800
|
||||||
|
|
||||||
class PypoFetch(Thread):
|
class PypoFetch(Thread):
|
||||||
|
|
||||||
def __init__(self, pypoFetch_q, pypoPush_q, media_q, telnet_lock, pypo_liquidsoap, config):
|
def __init__(self, pypoFetch_q, pypoPush_q, media_q, telnet_lock, pypo_liquidsoap, config):
|
||||||
Thread.__init__(self)
|
Thread.__init__(self)
|
||||||
|
|
||||||
|
#Hacky...
|
||||||
|
PypoFetch.ref = self
|
||||||
|
|
||||||
self.api_client = api_client.AirtimeApiClient()
|
self.api_client = api_client.AirtimeApiClient()
|
||||||
self.fetch_queue = pypoFetch_q
|
self.fetch_queue = pypoFetch_q
|
||||||
self.push_queue = pypoPush_q
|
self.push_queue = pypoPush_q
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import threading
|
import threading
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
import pypofetch
|
||||||
|
|
||||||
def __timeout(func, timeout_duration, default, args, kwargs):
|
def __timeout(func, timeout_duration, default, args, kwargs):
|
||||||
|
|
||||||
class InterruptableThread(threading.Thread):
|
class InterruptableThread(threading.Thread):
|
||||||
|
@ -24,6 +26,7 @@ def __timeout(func, timeout_duration, default, args, kwargs):
|
||||||
fails again then there is something critically wrong..."""
|
fails again then there is something critically wrong..."""
|
||||||
if first_attempt:
|
if first_attempt:
|
||||||
#restart liquidsoap
|
#restart liquidsoap
|
||||||
|
pypofetch.PypoFetch.ref.restart_liquidsoap()
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
raise Exception("Thread did not terminate")
|
raise Exception("Thread did not terminate")
|
||||||
|
|
Loading…
Reference in New Issue