Set titles for forked processes

This commit is contained in:
Nat Morris
2021-01-03 19:41:02 +00:00
committed by Blake Blackshear
parent 76403bba8e
commit 4619836122
5 changed files with 11 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ import signal
import queue
import multiprocessing as mp
from logging import handlers
from setproctitle import setproctitle
def listener_configurer():
@@ -31,6 +32,7 @@ def log_process(log_queue):
signal.signal(signal.SIGINT, receiveSignal)
threading.current_thread().name = f"logger"
setproctitle("frigate.logger")
listener_configurer()
while True:
if stop_event.is_set() and log_queue.empty():
@@ -72,4 +74,4 @@ class LogPipe(threading.Thread):
def close(self):
"""Close the write end of the pipe.
"""
os.close(self.fdWrite)
os.close(self.fdWrite)