From aa86dd632bfa3bda7dcea229612a599c8ab1f897 Mon Sep 17 00:00:00 2001 From: alice Date: Wed, 7 Oct 2020 17:33:44 +0200 Subject: [PATCH] ah fuck --- lambdainst/tasks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lambdainst/tasks.py b/lambdainst/tasks.py index cf6e711..16a5715 100644 --- a/lambdainst/tasks.py +++ b/lambdainst/tasks.py @@ -24,20 +24,23 @@ logger = logging.getLogger(__name__) @task(autoretry_for=(Exception,), default_retry_delay=60 * 60) def push_all_users(): + count = 0 for u in User.objects.all(): # skip 'empty' accounts if u.vpnuser.expiration is None: continue - logger.debug("pushing user %r", u) + logger.debug("pushing user #%d %r", user.id, user) django_lcore.sync_user(u.vpnuser, fail_silently=False) + count += 1 + logger.info("pushed %d users", count) @task(autoretry_for=(Exception,), max_retries=10, retry_backoff=True) def push_user(user_id): user = User.objects.get(id=user_id) - logger.debug("pushing user %r", user) + logger.info("pushing user #%d %r", user.id, user) django_lcore.sync_user(user.vpnuser, fail_silently=False) @@ -66,7 +69,6 @@ def notify_vpn_auth_fails(): NOTIFY_EVERY = timedelta(days=180) # users notified recently should be ignored def find_fails_for_user(u): - return True """ returns true if there are 'many' recent fails """ path = api.info["current_instance"] + "/users/" + u.username + "/auth-events/" try: