From aac45a60ab51dd7dc8471f0204656ad6136bb686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Thuret?= Date: Mon, 25 Oct 2021 17:12:09 +0200 Subject: [PATCH] remove scheduler if files translation is disabled --- app/app.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/app.py b/app/app.py index 7517207..f930842 100644 --- a/app/app.py +++ b/app/app.py @@ -13,8 +13,7 @@ from flask_swagger_ui import get_swaggerui_blueprint from translatehtml import translate_html from werkzeug.utils import secure_filename -from app import flood -from app import remove_translated_files +from app import flood, remove_translated_files from app.language import detect_languages, transliterate from .api_keys import Database from .suggestions import Database as SuggestionsDatabase @@ -29,9 +28,6 @@ def get_upload_dir(): return upload_dir -remove_translated_files.setup(get_upload_dir()) - - def get_json_dict(request): d = request.get_json() if not isinstance(d, dict): @@ -97,6 +93,9 @@ def create_app(args): if args.debug: app.config["TEMPLATES_AUTO_RELOAD"] = True + if not args.disable_files_translation: + remove_translated_files.setup(get_upload_dir()) + # Map userdefined frontend languages to argos language object. if args.frontend_language_source == "auto": frontend_argos_language_source = type(