Explorar o código

調整關db的時間

CJYen %!s(int64=4) %!d(string=hai) anos
pai
achega
169300f27b
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      main.py

+ 2 - 2
main.py

@@ -214,8 +214,8 @@ def receive(userid):
         return "ERROR: User Not Found"
     else:
         result = table.find_one(userid=userid)
-        db.close()
         return {"userid": result['userid'], "useraddress": result['useraddress']}
+    db.close()
 
 # send handler
 @app.post("/send")
@@ -237,7 +237,7 @@ async def receive(userModel : models.TransactionNft):
         return {'msg': 'user address not found'}
     else:
         userid = result['userid']
-        
+
 
     # update nft owner
     if table3.find_one(nftid=nftid):