Skip to content
Snippets Groups Projects
Commit 0eceea90 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch 'refactor/non-optional-celery' into 'master'

Make Celery non-optional

See merge request AlekSIS/official/AlekSIS-App-Untis!56
parents df57f33f 1ba10d79
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 ...@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_current_term
class Command(BaseCommand): class Command(BaseCommand):
def handle(self, *args, **options): 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 ...@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_all_terms
class Command(BaseCommand): class Command(BaseCommand):
def handle(self, *args, **options): 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 ...@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_current_future_terms
class Command(BaseCommand): class Command(BaseCommand):
def handle(self, *args, **options): 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 ...@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_current_next_term
class Command(BaseCommand): class Command(BaseCommand):
def handle(self, *args, **options): 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 ...@@ -5,4 +5,4 @@ from ...tasks import untis_import_mysql_future_terms
class Command(BaseCommand): class Command(BaseCommand):
def handle(self, *args, **options): 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 ( ...@@ -2,32 +2,32 @@ from aleksis.apps.untis.util.mysql.importers.terms import (
get_future_terms_for_date, get_future_terms_for_date,
get_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 from .util.mysql.main import untis_import_mysql as _untis_import_mysql
@celery_optional @app.task
def untis_import_mysql_current_term(): def untis_import_mysql_current_term():
"""Celery task for import of UNTIS data from MySQL (current term).""" """Celery task for import of UNTIS data from MySQL (current term)."""
terms = get_terms_for_date() terms = get_terms_for_date()
_untis_import_mysql(terms) _untis_import_mysql(terms)
@celery_optional @app.task
def untis_import_mysql_future_terms(): def untis_import_mysql_future_terms():
"""Celery task for import of UNTIS data from MySQL (all future terms).""" """Celery task for import of UNTIS data from MySQL (all future terms)."""
terms = get_future_terms_for_date() terms = get_future_terms_for_date()
_untis_import_mysql(terms) _untis_import_mysql(terms)
@celery_optional @app.task
def untis_import_mysql_all_terms(): def untis_import_mysql_all_terms():
"""Celery task for import of UNTIS data from MySQL (all terms in DB).""" """Celery task for import of UNTIS data from MySQL (all terms in DB)."""
_untis_import_mysql() _untis_import_mysql()
@celery_optional @app.task
def untis_import_mysql_current_next_term(): def untis_import_mysql_current_next_term():
"""Celery task for import of UNTIS data from MySQL (current and next term).""" """Celery task for import of UNTIS data from MySQL (current and next term)."""
terms = get_terms_for_date() terms = get_terms_for_date()
...@@ -37,7 +37,7 @@ def untis_import_mysql_current_next_term(): ...@@ -37,7 +37,7 @@ def untis_import_mysql_current_next_term():
_untis_import_mysql(terms) _untis_import_mysql(terms)
@celery_optional @app.task
def untis_import_mysql_current_future_terms(): def untis_import_mysql_current_future_terms():
"""Celery task for import of UNTIS data from MySQL (current and future terms).""" """Celery task for import of UNTIS data from MySQL (current and future terms)."""
terms = get_terms_for_date() 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