Browse Source

数据库连接test

22285461@qq.com 6 months ago
parent
commit
aaaa8ac176
1 changed files with 1 additions and 1 deletions
  1. 1 1
      main.py

+ 1 - 1
main.py

@@ -308,7 +308,7 @@ async def test(request: Request):
             content["db"] = "broke"
             content["db"] = "broke"
             database.close()
             database.close()
             database.connect()
             database.connect()
-            if database.is_connected():
+            if database.is_connection_usable():
                 content["db"] = "broke , reconnect"
                 content["db"] = "broke , reconnect"
             logging.info("reconnect database")
             logging.info("reconnect database")
     return JSONResponse(content=content, headers=headers)
     return JSONResponse(content=content, headers=headers)