Browse Source

refine db connection (#1494)

### What problem does this PR solve?



### Type of change


- [x] Refactoring
tags/v0.9.0
Kevin Hu 1 year ago
parent
commit
26de9adb41
No account linked to committer's email address
3 changed files with 3 additions and 3 deletions
  1. 1
    1
      api/db/db_models.py
  2. 1
    1
      api/ragflow_server.py
  3. 1
    1
      rag/llm/__init__.py

+ 1
- 1
api/db/db_models.py View File

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)

+ 1
- 1
api/ragflow_server.py View File

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)

+ 1
- 1
rag/llm/__init__.py View File

"BAAI": DefaultEmbedding, "BAAI": DefaultEmbedding,
"Mistral": MistralEmbed, "Mistral": MistralEmbed,
"Bedrock": BedrockEmbed, "Bedrock": BedrockEmbed,
"Gemini":GeminiEmbed,
"Gemini":GeminiEmbed
} }





Loading…
Cancel
Save