You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 21:53:54 +01:00
make it safer
This commit is contained in:
@@ -44,6 +44,7 @@ logger = log95.log95("radioPlayer", logger_level)
|
|||||||
|
|
||||||
exit_pending = False
|
exit_pending = False
|
||||||
intr_time = 0
|
intr_time = 0
|
||||||
|
exit_lock = threading.Lock()
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Process:
|
class Process:
|
||||||
@@ -105,6 +106,7 @@ procman = ProcessManager()
|
|||||||
|
|
||||||
def handle_sigint(signum, frame):
|
def handle_sigint(signum, frame):
|
||||||
global exit_pending, intr_time
|
global exit_pending, intr_time
|
||||||
|
with exit_lock:
|
||||||
logger.info("Received SIGINT")
|
logger.info("Received SIGINT")
|
||||||
if (time.time() - intr_time) > 5:
|
if (time.time() - intr_time) > 5:
|
||||||
intr_time = time.time()
|
intr_time = time.time()
|
||||||
|
|||||||
Reference in New Issue
Block a user