feat(chalice): conditional log
This commit is contained in:
parent
b8fc82d2f6
commit
3649061c15
1 changed files with 3 additions and 1 deletions
|
|
@ -35,7 +35,9 @@ async def or_middleware(request: Request, call_next):
|
|||
now = int(time.time() * 1000)
|
||||
response: StreamingResponse = await call_next(request)
|
||||
if helper.TRACK_TIME:
|
||||
print(f"Execution time: {int(time.time() * 1000) - now} ms")
|
||||
now = int(time.time() * 1000) - now
|
||||
if now > 500:
|
||||
print(f"Execution time: {now} ms")
|
||||
except Exception as e:
|
||||
pg_client.close()
|
||||
raise e
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue