From 0e3c28c7f1ea1054d2c7225e66d0840eae1cb76e Mon Sep 17 00:00:00 2001 From: emile Date: Thu, 21 Mar 2024 11:48:14 +0200 Subject: [PATCH] ss --- osinaweb/osinacore/tasks.py | 2 +- .../osinaweb/__pycache__/celery.cpython-310.pyc | Bin 738 -> 738 bytes osinaweb/osinaweb/celery.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osinaweb/osinacore/tasks.py b/osinaweb/osinacore/tasks.py index 13d12c95..1b1a2ac4 100644 --- a/osinaweb/osinacore/tasks.py +++ b/osinaweb/osinacore/tasks.py @@ -18,7 +18,7 @@ def set_offline(): # Create a new connection record for each user with status set to 'Offline' for user in users_without_working_points: last_connection = Connection.objects.filter(user=user).order_by('-date').first() - if last_connection is None or last_connection.status != 'Offline': + if last_connection.status != 'Offline': Connection.objects.create( status='Offline', date=timezone.now(), diff --git a/osinaweb/osinaweb/__pycache__/celery.cpython-310.pyc b/osinaweb/osinaweb/__pycache__/celery.cpython-310.pyc index 910dfb3b5a8c273bca1b3d01e279a74f1e5e45c4..8557f1657ff1b25152da45fb72c69b8cad0abf53 100644 GIT binary patch delta 19 ZcmaFF`iPY)pO=@50SE-&Z{)hc1OPIH1pxp6 delta 19 ZcmaFF`iPY)pO=@50SH_}H*(!z0st_(1e*W= diff --git a/osinaweb/osinaweb/celery.py b/osinaweb/osinaweb/celery.py index 3c37056b..3cf1c450 100644 --- a/osinaweb/osinaweb/celery.py +++ b/osinaweb/osinaweb/celery.py @@ -18,6 +18,6 @@ celery_app.autodiscover_tasks() celery_app.conf.beat_schedule = { 'set-offline-every-minute': { 'task': 'osinacore.tasks.set_offline', # Assuming your task is in tasks.py in your_app - 'schedule': crontab(minute='*/1'), # Run every minute + 'schedule': crontab(minute='*/15'), # Run every minute }, }