diff --git a/ccvpn/celery.py b/ccvpn/celery.py index 9aa5a44..bf80690 100644 --- a/ccvpn/celery.py +++ b/ccvpn/celery.py @@ -18,14 +18,39 @@ app = Celery('ccvpn') app.config_from_object('django.conf:settings', namespace='CELERY') app.conf.beat_schedule = { - 'payments__check_subscriptions': { - 'task': 'payments.tasks.check_subscriptions', - 'schedule': timedelta(hours=24), + # - - - payments + # + # check new payments every hour to ensure progress tracking + "payments__check_new": { + "task": "payments.tasks.check_new", + "schedule": timedelta(hours=1), + "options": {"queue": "maintenance"}, }, - 'payments__cancel_old_payments': { - 'task': 'payments.tasks.cancel_old_payments', - 'schedule': timedelta(hours=24), + # check payments that are supposed to renew soon + "payments__check_pending_subscriptions": { + "task": "payments.tasks.check_pending_subscriptions", + "schedule": timedelta(hours=1), + "options": {"queue": "maintenance"}, }, + # check error'd payments every 12 hours to avoid them getting stuck there + "payments__check_error": { + "task": "payments.tasks.check_error_payments", + "schedule": timedelta(hours=12), + "options": {"queue": "maintenance"}, + }, + # check active subscriptions every week + "payments__check_active_subscriptions": { + "task": "payments.tasks.check_active_subscriptions", + "schedule": timedelta(days=1), + "options": {"queue": "maintenance"}, + }, + # cancel inactive payments every day + "payments__cancel_old_payments": { + "task": "payments.tasks.cancel_old_payments", + "schedule": timedelta(hours=24), + "options": {"queue": "maintenance"}, + }, + 'lambdainst__resync': { 'task': 'lambdainst.tasks.push_all_users', 'schedule': timedelta(days=7),