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

@@ -8,6 +8,7 @@ import threading
import signal
from abc import ABC, abstractmethod
from multiprocessing.connection import Connection
from setproctitle import setproctitle
from typing import Dict
import numpy as np
@@ -110,6 +111,7 @@ def run_detector(name: str, detection_queue: mp.Queue, out_events: Dict[str, mp.
threading.current_thread().name = f"detector:{name}"
logger = logging.getLogger(f"detector.{name}")
logger.info(f"Starting detection process: {os.getpid()}")
setproctitle(f"frigate.detector.{name}")
listen()
stop_event = mp.Event()