File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ The main contents of this release are the introduction of the project sharing an
1717 * Modify ` GET /auth/current-user/allowed-viewer-paths/ ` logic, with ` include_shared_projects ` query parameter (\# 3031).
1818 * Add validator for paths to forbid parent-directory references (\# 3031).
1919* App:
20- * Add ` SlowResponseMiddleware ` middleware (\# 3035).
20+ * Add ` SlowResponseMiddleware ` middleware (\# 3035, \# 3038 ).
2121* Settings:
2222 * Add ` Settings.FRACTAL_LONG_REQUEST_TIME ` configuration variable (\# 3035).
2323* Database:
Original file line number Diff line number Diff line change @@ -134,8 +134,6 @@ async def lifespan(app: FastAPI):
134134
135135slow_response_logger = set_logger ("slow-response" )
136136
137- MIDDLEWARE_DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S.%f"
138-
139137
140138class SlowResponseMiddleware :
141139 def __init__ (self , app : FastAPI , time_threshold : float ):
@@ -171,8 +169,8 @@ async def send_wrapper(message: Message):
171169 f"?{ scope ['query_string' ].decode ('utf-8' )} , "
172170 f"{ context ['status_code' ]} , "
173171 f"{ request_time :.2f} , "
174- f"{ start_timestamp .strftime ( MIDDLEWARE_DATETIME_FORMAT )} , "
175- f"{ end_timestamp .strftime ( MIDDLEWARE_DATETIME_FORMAT )} "
172+ f"{ start_timestamp .isoformat ( timespec = 'milliseconds' )} , "
173+ f"{ end_timestamp .isoformat ( timespec = 'milliseconds' )} "
176174 )
177175
178176
You can’t perform that action at this time.
0 commit comments