Improve price information
All checks were successful
Django CI/CD / test (push) Successful in 1m1s
Django CI/CD / build-and-push (push) Successful in 2m9s

This commit is contained in:
2025-01-30 16:38:13 +01:00
parent 4ec808eeec
commit 6f62889e92
10 changed files with 123 additions and 15 deletions

View File

@ -11,6 +11,8 @@ class GamesConfig(AppConfig):
name = "games"
def ready(self):
import games.signals # noqa: F401
post_migrate.connect(schedule_tasks, sender=self)
@ -26,6 +28,14 @@ def schedule_tasks(sender, **kwargs):
next_run=now() + timedelta(seconds=30),
)
if not Schedule.objects.filter(name="Update price per game").exists():
schedule(
"games.tasks.calculate_price_per_game",
name="Update price per game",
schedule_type=Schedule.MINUTES,
next_run=now() + timedelta(seconds=30),
)
from games.models import ExchangeRate
if not ExchangeRate.objects.exists():