diff --git a/api/db/db_models.py b/api/db/db_models.py index 033a96688..4491526bf 100644 --- a/api/db/db_models.py +++ b/api/db/db_models.py @@ -332,7 +332,7 @@ DB.lock = DatabaseLock def close_connection(): try: if DB: - DB.close() + DB.close_stale(age=30) except Exception as e: LOGGER.exception(e) diff --git a/api/ragflow_server.py b/api/ragflow_server.py index a4e5b7715..8878817a3 100644 --- a/api/ragflow_server.py +++ b/api/ragflow_server.py @@ -94,7 +94,7 @@ if __name__ == '__main__': werkzeug_logger = logging.getLogger("werkzeug") for h in access_logger.handlers: werkzeug_logger.addHandler(h) - run_simple(hostname=HOST, port=HTTP_PORT, application=app, processes=5, use_reloader=RuntimeConfig.DEBUG, use_debugger=RuntimeConfig.DEBUG) + run_simple(hostname=HOST, port=HTTP_PORT, application=app, threaded=True, use_reloader=RuntimeConfig.DEBUG, use_debugger=RuntimeConfig.DEBUG) except Exception: traceback.print_exc() os.kill(os.getpid(), signal.SIGKILL) \ No newline at end of file diff --git a/rag/llm/__init__.py b/rag/llm/__init__.py index 3fdab822d..50b541f41 100644 --- a/rag/llm/__init__.py +++ b/rag/llm/__init__.py @@ -33,7 +33,7 @@ EmbeddingModel = { "BAAI": DefaultEmbedding, "Mistral": MistralEmbed, "Bedrock": BedrockEmbed, - "Gemini":GeminiEmbed, + "Gemini":GeminiEmbed }