forked from mirrors/LibreTranslate
remove scheduler if files translation is disabled
This commit is contained in:
parent
909deccd3f
commit
aac45a60ab
1 changed files with 4 additions and 5 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue