Don't create a repeating indexing task in the CLI

This commit is contained in:
tcely 2025-06-15 13:20:33 -04:00 committed by GitHub
parent 276eca0d28
commit beff72bf48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,7 @@ from django.utils.translation import gettext_lazy as _
from background_task.models import Task
from common.logger import log
from sync.models import Source
from sync.tasks import index_source_task, check_source_directory_exists
from sync.tasks import check_source_directory_exists
class Command(BaseCommand):
@ -23,15 +23,6 @@ class Command(BaseCommand):
str(source.pk),
verbose_name=verbose_name.format(source.name),
)
# Recreate the initial indexing task
log.info(f'Resetting tasks for source: {source}')
verbose_name = _('Index media from source "{}"')
index_source_task(
str(source.pk),
repeat=source.index_schedule,
schedule=source.task_run_at_dt,
verbose_name=verbose_name.format(source.name),
)
# This also chains down to call each Media objects .save() as well
source.save()