mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-26 09:04:31 +08:00
refine db connection (#1494)
### What problem does this PR solve? ### Type of change - [x] Refactoring
This commit is contained in:
parent
0c9a7caa9d
commit
26de9adb41
@ -332,7 +332,7 @@ DB.lock = DatabaseLock
|
|||||||
def close_connection():
|
def close_connection():
|
||||||
try:
|
try:
|
||||||
if DB:
|
if DB:
|
||||||
DB.close()
|
DB.close_stale(age=30)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LOGGER.exception(e)
|
LOGGER.exception(e)
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ if __name__ == '__main__':
|
|||||||
werkzeug_logger = logging.getLogger("werkzeug")
|
werkzeug_logger = logging.getLogger("werkzeug")
|
||||||
for h in access_logger.handlers:
|
for h in access_logger.handlers:
|
||||||
werkzeug_logger.addHandler(h)
|
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:
|
except Exception:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
os.kill(os.getpid(), signal.SIGKILL)
|
os.kill(os.getpid(), signal.SIGKILL)
|
@ -33,7 +33,7 @@ EmbeddingModel = {
|
|||||||
"BAAI": DefaultEmbedding,
|
"BAAI": DefaultEmbedding,
|
||||||
"Mistral": MistralEmbed,
|
"Mistral": MistralEmbed,
|
||||||
"Bedrock": BedrockEmbed,
|
"Bedrock": BedrockEmbed,
|
||||||
"Gemini":GeminiEmbed,
|
"Gemini":GeminiEmbed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user