mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Sort out Event disambiguity
There was a name collision of multiprocessing Event type and frigate events
This commit is contained in:
parent
6929db0b1c
commit
4d6de35534
@ -1,7 +1,7 @@
|
||||
import logging
|
||||
import multiprocessing as mp
|
||||
from multiprocessing.queues import Queue
|
||||
from multiprocessing.synchronize import Event
|
||||
from multiprocessing.synchronize import Event as MpEvent
|
||||
import os
|
||||
import signal
|
||||
import sys
|
||||
@ -38,10 +38,10 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class FrigateApp:
|
||||
def __init__(self) -> None:
|
||||
self.stop_event: Event = mp.Event()
|
||||
self.stop_event: MpEvent = mp.Event()
|
||||
self.detection_queue: Queue = mp.Queue()
|
||||
self.detectors: dict[str, ObjectDetectProcess] = {}
|
||||
self.detection_out_events: dict[str, Event] = {}
|
||||
self.detection_out_events: dict[str, MpEvent] = {}
|
||||
self.detection_shms: list[mp.shared_memory.SharedMemory] = []
|
||||
self.log_queue: Queue = mp.Queue()
|
||||
self.plus_api = PlusApi()
|
||||
|
||||
@ -14,6 +14,7 @@ from frigate.models import Event
|
||||
from frigate.types import CameraMetricsTypes
|
||||
|
||||
from multiprocessing.queues import Queue
|
||||
from multiprocessing.synchronize import Event as MpEvent
|
||||
from typing import Dict
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -47,7 +48,7 @@ class EventProcessor(threading.Thread):
|
||||
camera_processes: dict[str, CameraMetricsTypes],
|
||||
event_queue: Queue,
|
||||
event_processed_queue: Queue,
|
||||
stop_event: Event,
|
||||
stop_event: MpEvent,
|
||||
):
|
||||
threading.Thread.__init__(self)
|
||||
self.name = "event_processor"
|
||||
@ -158,7 +159,7 @@ class EventProcessor(threading.Thread):
|
||||
|
||||
|
||||
class EventCleanup(threading.Thread):
|
||||
def __init__(self, config: FrigateConfig, stop_event: Event):
|
||||
def __init__(self, config: FrigateConfig, stop_event: MpEvent):
|
||||
threading.Thread.__init__(self)
|
||||
self.name = "event_cleanup"
|
||||
self.config = config
|
||||
|
||||
@ -8,7 +8,7 @@ import os
|
||||
import requests
|
||||
from typing import Optional, Any
|
||||
from paho.mqtt.client import Client
|
||||
from multiprocessing.synchronize import Event
|
||||
from multiprocessing.synchronize import Event as MpEvent
|
||||
|
||||
from frigate.config import FrigateConfig
|
||||
from frigate.const import RECORD_DIR, CLIPS_DIR, CACHE_DIR
|
||||
@ -148,7 +148,7 @@ class StatsEmitter(threading.Thread):
|
||||
stats_tracking: StatsTrackingTypes,
|
||||
mqtt_client: Client,
|
||||
topic_prefix: str,
|
||||
stop_event: Event,
|
||||
stop_event: MpEvent,
|
||||
):
|
||||
threading.Thread.__init__(self)
|
||||
self.name = "frigate_stats_emitter"
|
||||
|
||||
@ -7,13 +7,13 @@ import signal
|
||||
|
||||
from frigate.object_detection import ObjectDetectProcess
|
||||
from frigate.util import restart_frigate
|
||||
from multiprocessing.synchronize import Event
|
||||
from multiprocessing.synchronize import Event as MpEvent
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FrigateWatchdog(threading.Thread):
|
||||
def __init__(self, detectors: dict[str, ObjectDetectProcess], stop_event: Event):
|
||||
def __init__(self, detectors: dict[str, ObjectDetectProcess], stop_event: MpEvent):
|
||||
threading.Thread.__init__(self)
|
||||
self.name = "frigate_watchdog"
|
||||
self.detectors = detectors
|
||||
|
||||
Loading…
Reference in New Issue
Block a user