From 32b9a9fbcf9f7f1b1ee594ec9e3168261d691e18 Mon Sep 17 00:00:00 2001 From: zouxiaochuan Date: Wed, 7 Feb 2024 19:01:16 +0800 Subject: [PATCH] fix(backend): fix 'missing authorization header' error --- backend/scripts/main.py | 2 ++ backend/scripts/monitor_learnware_verify.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/scripts/main.py b/backend/scripts/main.py index 7e82d5f..300f1cf 100644 --- a/backend/scripts/main.py +++ b/backend/scripts/main.py @@ -34,6 +34,8 @@ CORS(app) bcrypt = flask_bcrypt.Bcrypt(app) jwt = flask_jwt_extended.JWTManager(app) Markdown(app) +# fix for gunicorn bug +app.config["PROPAGATE_EXCEPTIONS"] = True @jwt.unauthorized_loader diff --git a/backend/scripts/monitor_learnware_verify.py b/backend/scripts/monitor_learnware_verify.py index 1cbb01b..5f98193 100644 --- a/backend/scripts/monitor_learnware_verify.py +++ b/backend/scripts/monitor_learnware_verify.py @@ -222,7 +222,7 @@ def worker_process_func(q: queue.Queue, env: dict): def main(num_worker): context.init_database() - context.init_logger(target="file") + context.init_logger() context.init_engine() context.init_redis() context.init_sensitive_words()