Use celery tasks instead of systemd timers for periodic work; and add more tests
All checks were successful
Deploy to Server / deploy (push) Successful in 26s
All checks were successful
Deploy to Server / deploy (push) Successful in 26s
This commit is contained in:
parent
333476b30b
commit
66ea46cf23
25 changed files with 2133 additions and 104 deletions
|
|
@ -8,7 +8,8 @@ from twitch.models import Channel
|
|||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
from debug_toolbar.panels.templates.panel import QuerySet
|
||||
from django.db.models import QuerySet
|
||||
|
||||
|
||||
SAMPLE_PREVIEW_COUNT = 10
|
||||
|
||||
|
|
|
|||
|
|
@ -193,8 +193,8 @@ class Command(BaseCommand):
|
|||
img.mode == "P" and "transparency" in img.info
|
||||
):
|
||||
# Create white background for transparency
|
||||
background = Image.new("RGB", img.size, (255, 255, 255))
|
||||
rgba_img = img.convert("RGBA") if img.mode == "P" else img
|
||||
background: Image.Image = Image.new("RGB", img.size, (255, 255, 255))
|
||||
rgba_img: Image.Image = img.convert("RGBA") if img.mode == "P" else img
|
||||
background.paste(
|
||||
rgba_img,
|
||||
mask=rgba_img.split()[-1] if rgba_img.mode in {"RGBA", "LA"} else None,
|
||||
|
|
|
|||
|
|
@ -17,9 +17,16 @@ logger: logging.Logger = logging.getLogger("ttvdrops.watch_imports")
|
|||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""Watch for JSON files in a directory and import them automatically."""
|
||||
"""Watch for JSON files in a directory and import them automatically.
|
||||
|
||||
help = "Watch a directory for JSON files and import them automatically"
|
||||
.. deprecated::
|
||||
This command is superseded by the Celery Beat task
|
||||
``twitch.tasks.scan_pending_twitch_files`` (runs every 10 s via
|
||||
``ttvdrops-celery-beat.service``). Keep this command for ad-hoc use
|
||||
or in environments that run without a Celery worker.
|
||||
"""
|
||||
|
||||
help = "Watch a directory for JSON files and import them automatically (superseded by Celery Beat)"
|
||||
requires_migrations_checks = True
|
||||
|
||||
def add_arguments(self, parser: CommandParser) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue