From 349e48a0189dfa73732f2e06971427941ab8dee4 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Sat, 4 Jan 2025 10:27:14 -0500 Subject: [PATCH] doorcontrol: Update UniFi Access user data every 5 minutes --- doorcontrol/apps.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doorcontrol/apps.py b/doorcontrol/apps.py index 2f31fc6..f66acca 100644 --- a/doorcontrol/apps.py +++ b/doorcontrol/apps.py @@ -9,7 +9,7 @@ def post_migrate_callback(sender, **kwargs): from .tasks.scrapehidevents import q_getMessagesAllDoors from .tasks.update_doors import q_update_all_doors - from .tasks.update_unifi_access import update_access + from .tasks.update_unifi_access import update_access, update_access_users ensure_scheduled( q_getMessagesAllDoors, @@ -29,6 +29,12 @@ def post_migrate_callback(sender, **kwargs): minutes=5, ) + ensure_scheduled( + update_access_users, + schedule_type=Schedule.MINUTES, + minutes=5, + ) + class DoorControlConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField"