@@ -766,8 +766,7 @@ async def check_orion():
766766 "message" : None if status else "Failed to connect" }
767767 except Exception as e :
768768 logging .error (f"Error checking Orion: { e } " )
769- return {"status" : False , "latency" : latency ,
770- "latency_unit" : "ms" , "message" : str (e )}
769+ return {"status" : False , "message" : str (e )}
771770async def check_postgres ():
772771 """
773772 Check whether the PostgreSQL database is running properly.
@@ -780,10 +779,8 @@ async def check_postgres():
780779 return {"status" : True , "latency" : latency ,
781780 "latency_unit" : "ms" , "message" : None }
782781 except Exception as e :
783- latency = (time .time () - start_time )* 1000
784782 logging .error (f"Error checking PostgreSQL: { e } " )
785- return {"status" : False , "latency" : latency ,
786- "latency_unit" : "ms" , "message" : str (e )}
783+ return {"status" : False , "message" : str (e )}
787784async def check_redis ():
788785 """
789786 Check whether the Redis cache is running properly.
@@ -795,10 +792,8 @@ async def check_redis():
795792 return {"status" : True , "latency" : latency ,
796793 "latency_unit" : "ms" , "message" : None }
797794 except Exception as e :
798- latency = (time .time () - start_time )* 1000
799795 logging .error (f"Error checking Redis: { e } " )
800- return {"status" : False , "latency" : latency ,
801- "latency_unit" : "ms" , "message" : str (e )}
796+ return {"status" : False , "message" : str (e )}
802797if __name__ == "__main__" :
803798 uvicorn .run (app , host = "0.0.0.0" , port = 8000 , reload = True ,
804799 log_level = settings .LOG_LEVEL .lower ())
0 commit comments