From 91490a7d626e8304393d31bfd136c17bb122abc9 Mon Sep 17 00:00:00 2001 From: alice Date: Sat, 29 Aug 2020 20:54:04 +0200 Subject: [PATCH] quick fixes --- ccvpn/celery.py | 9 +++++---- lambdainst/views.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ccvpn/celery.py b/ccvpn/celery.py index eb7be6d..2953a74 100644 --- a/ccvpn/celery.py +++ b/ccvpn/celery.py @@ -4,6 +4,7 @@ import os from celery import Celery from celery.schedules import crontab +from datetime import timedelta # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ccvpn.settings') @@ -19,19 +20,19 @@ app.config_from_object('django.conf:settings', namespace='CELERY') app.conf.beat_schedule = { 'payments__check_subscriptions': { 'task': 'payments.tasks.check_subscriptions', - 'schedule': crontab(hour=1), + 'schedule': timedelta(hours=24), }, 'payments__cancel_old_payments': { 'task': 'payments.tasks.cancel_old_payments', - 'schedule': crontab(hour=2), + 'schedule': timedelta(hours=24), }, 'lambdainst__resync': { 'task': 'lambdainst.tasks.push_all_users', - 'schedule': crontab(day_of_week=1), + 'schedule': timedelta(days=7), }, 'lambdainst__notify_account_expiration': { 'task': 'lambdainst.tasks.notify_account_expiration', - 'schedule': crontab(hour='*/6'), + 'schedule': timedelta(hours=6), }, } diff --git a/lambdainst/views.py b/lambdainst/views.py index d21dbf9..34604b0 100644 --- a/lambdainst/views.py +++ b/lambdainst/views.py @@ -284,7 +284,7 @@ def make_export_zip(user, name): with z.open(name + "/wireguard_peers.json", "w") as jf: try: - keys = map(process_wg_peer, django_lcore.api.get_wg_peers(user.username)) + keys = list(map(process_wg_peer, django_lcore.api.get_wg_peers(user.username))) except lcoreapi.APINotFoundError: keys = [] jf.write(json.dumps(keys, indent=2).encode('ascii'))