mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Re-create plus api if config based env var is being used
This commit is contained in:
parent
1d45b0b351
commit
c341e2b46c
@ -20,7 +20,7 @@ from playhouse.sqliteq import SqliteQueueDatabase
|
||||
from pydantic import ValidationError
|
||||
|
||||
from frigate.config import DetectorTypeEnum, FrigateConfig
|
||||
from frigate.const import CACHE_DIR, CLIPS_DIR, RECORD_DIR
|
||||
from frigate.const import CACHE_DIR, CLIPS_DIR, PLUS_ENV_VAR, RECORD_DIR
|
||||
from frigate.edgetpu import EdgeTPUProcess
|
||||
from frigate.events import EventCleanup, EventProcessor
|
||||
from frigate.http import create_app
|
||||
@ -55,6 +55,11 @@ class FrigateApp:
|
||||
for key, value in self.config.environment_vars.items():
|
||||
os.environ[key] = value
|
||||
|
||||
# plus needs to be re-created if API KEY
|
||||
# is included in config env vars
|
||||
if key == PLUS_ENV_VAR:
|
||||
self.plus_api = PlusApi()
|
||||
|
||||
def ensure_dirs(self) -> None:
|
||||
for d in [RECORD_DIR, CLIPS_DIR, CACHE_DIR]:
|
||||
if not os.path.exists(d) and not os.path.islink(d):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user