2022-02-03 13:45:58 -05:00
|
|
|
from django.apps import AppConfig
|
2023-12-04 11:27:04 -05:00
|
|
|
from django.db.models.signals import post_migrate
|
|
|
|
|
|
|
|
|
|
|
|
def post_migrate_callback(sender, **kwargs):
|
|
|
|
from django_q.models import Schedule
|
|
|
|
|
|
|
|
from cmsmanage.django_q2_helper import ensure_scheduled
|
|
|
|
|
2024-01-17 21:17:24 -05:00
|
|
|
from .tasks.scrape import scrape_events, scrape_membershipworks
|
2023-12-04 11:27:04 -05:00
|
|
|
from .tasks.ucsAccounts import sync_accounts
|
|
|
|
|
2023-12-19 13:25:40 -05:00
|
|
|
ensure_scheduled(
|
2024-02-01 11:10:22 -05:00
|
|
|
scrape_membershipworks.q_task_group,
|
2023-12-19 13:25:40 -05:00
|
|
|
scrape_membershipworks,
|
|
|
|
schedule_type=Schedule.HOURLY,
|
|
|
|
)
|
|
|
|
|
2023-12-30 14:34:55 -05:00
|
|
|
ensure_scheduled(
|
2024-02-01 11:10:22 -05:00
|
|
|
scrape_events.q_task_group,
|
2023-12-30 14:34:55 -05:00
|
|
|
scrape_events,
|
|
|
|
schedule_type=Schedule.HOURLY,
|
|
|
|
)
|
|
|
|
|
2023-12-04 11:27:04 -05:00
|
|
|
ensure_scheduled(
|
2024-02-01 11:10:22 -05:00
|
|
|
sync_accounts.q_task_group,
|
2023-12-04 11:27:04 -05:00
|
|
|
sync_accounts,
|
|
|
|
schedule_type=Schedule.MINUTES,
|
|
|
|
minutes=15,
|
|
|
|
)
|
2022-02-03 13:45:58 -05:00
|
|
|
|
|
|
|
|
|
|
|
class MembershipworksConfig(AppConfig):
|
2022-02-11 13:48:47 -05:00
|
|
|
default_auto_field = "django.db.models.BigAutoField"
|
|
|
|
name = "membershipworks"
|
2023-12-04 11:27:04 -05:00
|
|
|
|
|
|
|
def ready(self):
|
|
|
|
post_migrate.connect(post_migrate_callback, sender=self)
|