blueprints: file file observer on macos (#8472)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2024-02-12 00:17:56 +01:00
committed by GitHub
parent 7db598c04e
commit 08c850938b

View File

@ -3,6 +3,7 @@
from dataclasses import asdict, dataclass, field
from hashlib import sha512
from pathlib import Path
from sys import platform
from typing import Optional
from dacite.core import from_dict
@ -60,11 +61,11 @@ def start_blueprint_watcher():
if _file_watcher_started:
return
observer = Observer()
kwargs = {}
if platform.startswith("linux"):
kwargs["event_filter"] = (FileCreatedEvent, FileModifiedEvent)
observer.schedule(
BlueprintEventHandler(),
CONFIG.get("blueprints_dir"),
recursive=True,
event_filter=(FileCreatedEvent, FileModifiedEvent),
BlueprintEventHandler(), CONFIG.get("blueprints_dir"), recursive=True, **kwargs
)
observer.start()
_file_watcher_started = True