From 81bf614afaf2eaeda6bb206b04678d2ae855e2e2 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 12 Jul 2024 14:30:39 +0200 Subject: [PATCH] fix version check not triggering --- tubearchivist/config/management/commands/ta_startup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tubearchivist/config/management/commands/ta_startup.py b/tubearchivist/config/management/commands/ta_startup.py index 80f8edf1..b3e72106 100644 --- a/tubearchivist/config/management/commands/ta_startup.py +++ b/tubearchivist/config/management/commands/ta_startup.py @@ -12,6 +12,7 @@ from django.conf import settings from django.core.management.base import BaseCommand, CommandError from django_celery_beat.models import CrontabSchedule from home.models import CustomPeriodicTask +from home.tasks import version_check from home.src.es.connect import ElasticWrap from home.src.es.index_setup import ElasitIndexWrap from home.src.es.snapshot import ElasticSnapshot @@ -147,6 +148,14 @@ class Command(BaseCommand): else: self.stdout.write(self.style.SUCCESS(" no new update found")) + version_task = CustomPeriodicTask.objects.filter(name="version_check") + if not version_task.exists(): + return + + if not version_task.first().last_run_at: + self.style.SUCCESS(" ✓ send initial version check task") + version_check.delay() + def _mig_index_setup(self): """migration: validate index mappings""" self.stdout.write("[MIGRATION] validate index mappings")