mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-09 08:12:48 +03:00
Require setting process priority for FrigateProcess (#19207)
This commit is contained in:
committed by
Blake Blackshear
parent
d071325ca7
commit
20104761e8
@@ -21,6 +21,7 @@ from frigate.const import (
|
||||
EXPORT_DIR,
|
||||
MAX_PLAYLIST_SECONDS,
|
||||
PREVIEW_FRAME_TYPE,
|
||||
PROCESS_PRIORITY_LOW,
|
||||
)
|
||||
from frigate.ffmpeg_presets import (
|
||||
EncodeTypeEnum,
|
||||
@@ -36,7 +37,7 @@ TIMELAPSE_DATA_INPUT_ARGS = "-an -skip_frame nokey"
|
||||
|
||||
|
||||
def lower_priority():
|
||||
os.nice(10)
|
||||
os.nice(PROCESS_PRIORITY_LOW)
|
||||
|
||||
|
||||
class PlaybackFactorEnum(str, Enum):
|
||||
|
||||
@@ -6,6 +6,7 @@ from multiprocessing.synchronize import Event as MpEvent
|
||||
from playhouse.sqliteq import SqliteQueueDatabase
|
||||
|
||||
from frigate.config import FrigateConfig
|
||||
from frigate.const import PROCESS_PRIORITY_HIGH
|
||||
from frigate.models import Recordings, ReviewSegment
|
||||
from frigate.record.maintainer import RecordingMaintainer
|
||||
from frigate.util.process import FrigateProcess
|
||||
@@ -15,7 +16,12 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
class RecordProcess(FrigateProcess):
|
||||
def __init__(self, config: FrigateConfig, stop_event: MpEvent) -> None:
|
||||
super().__init__(stop_event, name="frigate.recording_manager", daemon=True)
|
||||
super().__init__(
|
||||
stop_event,
|
||||
PROCESS_PRIORITY_HIGH,
|
||||
name="frigate.recording_manager",
|
||||
daemon=True,
|
||||
)
|
||||
self.config = config
|
||||
|
||||
def run(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user