doorcontrol: Register tasks in post migrate hook to fix uvicorn issue
This commit is contained in:
parent
6408748c3f
commit
a90cd39612
@ -1,4 +1,11 @@
|
||||
from django.apps import AppConfig
|
||||
from django.db.models.signals import post_migrate
|
||||
|
||||
|
||||
def post_migrate_callback(sender, **kwargs):
|
||||
from .tasks.scrapehidevents import schedule_tasks
|
||||
|
||||
schedule_tasks()
|
||||
|
||||
|
||||
class DoorControlConfig(AppConfig):
|
||||
@ -7,6 +14,4 @@ class DoorControlConfig(AppConfig):
|
||||
verbose_name = "Door Control"
|
||||
|
||||
def ready(self):
|
||||
from .tasks.scrapehidevents import schedule_tasks
|
||||
|
||||
schedule_tasks()
|
||||
post_migrate.connect(post_migrate_callback, sender=self)
|
||||
|
Loading…
Reference in New Issue
Block a user