2023-01-24 21:21:26 -05:00
|
|
|
from django.apps import AppConfig
|
2023-11-14 12:51:33 -05:00
|
|
|
from django.db.models.signals import post_migrate
|
|
|
|
|
|
|
|
|
|
|
|
def post_migrate_callback(sender, **kwargs):
|
2023-12-01 23:50:41 -05:00
|
|
|
from django_q.models import Schedule
|
2023-11-14 12:51:33 -05:00
|
|
|
|
2023-12-01 23:50:41 -05:00
|
|
|
from cmsmanage.django_q2_helper import ensure_scheduled
|
|
|
|
|
|
|
|
from .tasks.scrapehidevents import q_getMessagesAllDoors
|
2024-02-23 15:55:16 -05:00
|
|
|
from .tasks.update_doors import q_update_all_doors
|
2023-12-01 23:50:41 -05:00
|
|
|
|
|
|
|
ensure_scheduled(
|
|
|
|
q_getMessagesAllDoors,
|
|
|
|
schedule_type=Schedule.MINUTES,
|
|
|
|
minutes=15,
|
|
|
|
)
|
2023-01-24 21:21:26 -05:00
|
|
|
|
2024-02-23 15:55:16 -05:00
|
|
|
ensure_scheduled(
|
|
|
|
q_update_all_doors,
|
|
|
|
schedule_type=Schedule.MINUTES,
|
|
|
|
minutes=15,
|
|
|
|
)
|
|
|
|
|
2023-01-24 21:21:26 -05:00
|
|
|
|
|
|
|
class DoorControlConfig(AppConfig):
|
|
|
|
default_auto_field = "django.db.models.BigAutoField"
|
|
|
|
name = "doorcontrol"
|
|
|
|
verbose_name = "Door Control"
|
2023-11-08 12:34:11 -05:00
|
|
|
|
|
|
|
def ready(self):
|
2023-11-14 12:51:33 -05:00
|
|
|
post_migrate.connect(post_migrate_callback, sender=self)
|