diff --git a/src/openforms/conf/base.py b/src/openforms/conf/base.py index bd1549b7b3..7d427efd90 100644 --- a/src/openforms/conf/base.py +++ b/src/openforms/conf/base.py @@ -780,6 +780,10 @@ "task": "openforms.authentication.tasks.update_saml_metadata", "schedule": crontab(hour=0, minute=0, day_of_week="sunday"), }, + "import-open-producten-prices": { + "task": "openforms.contrib.open_producten.tasks.import_product_type_prices", + "schedule": crontab(hour=0, minute=0, day_of_week="*"), + }, } RETRY_SUBMISSIONS_TIME_LIMIT = config( diff --git a/src/openforms/contrib/open_producten/tasks.py b/src/openforms/contrib/open_producten/tasks.py new file mode 100644 index 0000000000..3059c2732d --- /dev/null +++ b/src/openforms/contrib/open_producten/tasks.py @@ -0,0 +1,21 @@ +import io +import logging + +from django.core.management import call_command + +from openforms.celery import app + +logger = logging.getLogger(__name__) + + +@app.task() +def import_product_type_prices(): + logger.info("starting import_prices() task") + + out = io.StringIO() + + call_command("import_prices", stdout=out) + + logger.info("finished import_prices() task") + + return out.getvalue()