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