mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 05:26:37 +00:00
Fixes for ruff check
in reset-tasks.py
This commit is contained in:
parent
c69cd7f582
commit
2ece2e7f38
@ -1,14 +1,12 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.core.management.base import BaseCommand, CommandError # noqa
|
||||
from django.db.transaction import atomic
|
||||
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 common.logger import log
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
help = 'Resets all tasks'
|
||||
@ -31,10 +29,10 @@ class Command(BaseCommand):
|
||||
index_source_task(
|
||||
str(source.pk),
|
||||
repeat=source.index_schedule,
|
||||
schedule=source.index_schedule,
|
||||
verbose_name=verbose_name.format(source.name),
|
||||
)
|
||||
with atomic(durable=True):
|
||||
for source in Source.objects.all():
|
||||
# This also chains down to call each Media objects .save() as well
|
||||
source.save()
|
||||
|
||||
log.info('Done')
|
||||
|
Loading…
Reference in New Issue
Block a user