|
|
@ -18,14 +18,39 @@ app = Celery('ccvpn')
|
|
|
|
app.config_from_object('django.conf:settings', namespace='CELERY')
|
|
|
|
app.config_from_object('django.conf:settings', namespace='CELERY')
|
|
|
|
|
|
|
|
|
|
|
|
app.conf.beat_schedule = {
|
|
|
|
app.conf.beat_schedule = {
|
|
|
|
'payments__check_subscriptions': {
|
|
|
|
# - - - payments
|
|
|
|
'task': 'payments.tasks.check_subscriptions',
|
|
|
|
#
|
|
|
|
'schedule': timedelta(hours=24),
|
|
|
|
# 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': {
|
|
|
|
# check payments that are supposed to renew soon
|
|
|
|
'task': 'payments.tasks.cancel_old_payments',
|
|
|
|
"payments__check_pending_subscriptions": {
|
|
|
|
'schedule': timedelta(hours=24),
|
|
|
|
"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': {
|
|
|
|
'lambdainst__resync': {
|
|
|
|
'task': 'lambdainst.tasks.push_all_users',
|
|
|
|
'task': 'lambdainst.tasks.push_all_users',
|
|
|
|
'schedule': timedelta(days=7),
|
|
|
|
'schedule': timedelta(days=7),
|
|
|
|