Skip to content
Snippets Groups Projects
Verified Commit 1ba10d79 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Make Celery non-optional

parent df57f33f
No related branches found
No related tags found
No related merge requests found
......@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_current_term
class Command(BaseCommand):
def handle(self, *args, **options):
untis_import_mysql_current_term()
untis_import_mysql_current_term.delay()
......@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_all_terms
class Command(BaseCommand):
def handle(self, *args, **options):
untis_import_mysql_all_terms()
untis_import_mysql_all_terms.delay()
......@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_current_future_terms
class Command(BaseCommand):
def handle(self, *args, **options):
untis_import_mysql_current_future_terms()
untis_import_mysql_current_future_terms.delay()
......@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_current_next_term
class Command(BaseCommand):
def handle(self, *args, **options):
untis_import_mysql_current_next_term()
untis_import_mysql_current_next_term.delay()
......@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_future_terms
class Command(BaseCommand):
def handle(self, *args, **options):
untis_import_mysql_future_terms()
untis_import_mysql_future_terms.delay()
......@@ -2,32 +2,32 @@ from aleksis.apps.untis.util.mysql.importers.terms import (
get_future_terms_for_date,
get_terms_for_date,
)
from aleksis.core.util.core_helpers import celery_optional
from aleksis.core.celery import app
from .util.mysql.main import untis_import_mysql as _untis_import_mysql
@celery_optional
@app.task
def untis_import_mysql_current_term():
"""Celery task for import of UNTIS data from MySQL (current term)."""
terms = get_terms_for_date()
_untis_import_mysql(terms)
@celery_optional
@app.task
def untis_import_mysql_future_terms():
"""Celery task for import of UNTIS data from MySQL (all future terms)."""
terms = get_future_terms_for_date()
_untis_import_mysql(terms)
@celery_optional
@app.task
def untis_import_mysql_all_terms():
"""Celery task for import of UNTIS data from MySQL (all terms in DB)."""
_untis_import_mysql()
@celery_optional
@app.task
def untis_import_mysql_current_next_term():
"""Celery task for import of UNTIS data from MySQL (current and next term)."""
terms = get_terms_for_date()
......@@ -37,7 +37,7 @@ def untis_import_mysql_current_next_term():
_untis_import_mysql(terms)
@celery_optional
@app.task
def untis_import_mysql_current_future_terms():
"""Celery task for import of UNTIS data from MySQL (current and future terms)."""
terms = get_terms_for_date()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment