From 6aef44d3dc846123487f18cdd1bf0c79005a9754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Mon, 11 Nov 2024 01:12:09 +0100 Subject: [PATCH] Rename tasks --- games/apps.py | 2 +- .../{schedule_update_task.py => schedule_convert_prices.py} | 2 +- games/{convert_price.py => tasks.py} | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename games/management/commands/{schedule_update_task.py => schedule_convert_prices.py} (92%) rename games/{convert_price.py => tasks.py} (98%) diff --git a/games/apps.py b/games/apps.py index 9443bc5..cc6588c 100644 --- a/games/apps.py +++ b/games/apps.py @@ -20,7 +20,7 @@ def schedule_tasks(sender, **kwargs): if not Schedule.objects.filter(name="Update converted prices").exists(): schedule( - "games.convert_price.update_converted_prices", + "games.tasks.convert_prices", name="Update converted prices", schedule_type=Schedule.MINUTES, next_run=now() + timedelta(seconds=30), diff --git a/games/management/commands/schedule_update_task.py b/games/management/commands/schedule_convert_prices.py similarity index 92% rename from games/management/commands/schedule_update_task.py rename to games/management/commands/schedule_convert_prices.py index 50d970c..59af680 100644 --- a/games/management/commands/schedule_update_task.py +++ b/games/management/commands/schedule_convert_prices.py @@ -12,7 +12,7 @@ class Command(BaseCommand): def handle(self, *args, **kwargs): if not Schedule.objects.filter(name="Update converted prices").exists(): schedule( - "games.convert_price.update_converted_prices", + "games.tasks.convert_prices", name="Update converted prices", schedule_type=Schedule.MINUTES, next_run=now() + timedelta(seconds=30), diff --git a/games/convert_price.py b/games/tasks.py similarity index 98% rename from games/convert_price.py rename to games/tasks.py index 815b3a0..93558a7 100644 --- a/games/convert_price.py +++ b/games/tasks.py @@ -16,7 +16,7 @@ def save_converted_info(purchase, converted_price, converted_currency): purchase.save() -def update_converted_prices(): +def convert_prices(): purchases = Purchase.objects.filter( converted_price__isnull=True, converted_currency__isnull=True )