Update middlewares.
All checks were successful
Build Base Application / Build (push) Successful in 1m36s
All checks were successful
Build Base Application / Build (push) Successful in 1m36s
This commit is contained in:
parent
52ed6a88ec
commit
fb82a77ed4
@ -73,10 +73,10 @@ class BaseApplication(web.Application):
|
|||||||
return await handler(request)
|
return await handler(request)
|
||||||
|
|
||||||
@web.middleware
|
@web.middleware
|
||||||
async def request_middleware(self, request, handler):
|
async def request_middleware(self, request:web.Request, handler):
|
||||||
time_start = time.time()
|
time_start = time.time()
|
||||||
created = get_timestamp()
|
created = get_timestamp()
|
||||||
request = await handler(request)
|
response = await handler(request)
|
||||||
time_end = time.time()
|
time_end = time.time()
|
||||||
await self.insert(
|
await self.insert(
|
||||||
"http_access",
|
"http_access",
|
||||||
@ -86,7 +86,7 @@ class BaseApplication(web.Application):
|
|||||||
"duration": time_end - time_start,
|
"duration": time_end - time_start,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
return request
|
return response
|
||||||
|
|
||||||
@web.middleware
|
@web.middleware
|
||||||
async def session_middleware(self, request, handler):
|
async def session_middleware(self, request, handler):
|
||||||
|
Loading…
Reference in New Issue
Block a user