From fa00e13dc6d6acc9d98e70589f3cf88e951a1abd Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 6 Nov 2020 11:27:42 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index e25f29d..4b6d3d5 100644 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -118,12 +118,11 @@ class ProcessorResource(StaticResource,Url2File): return ns async def _handle(self,request:Request) -> StreamResponse: - t = TimeCost() name = str(request.url) - t.begin(name) - x = self._handle1(request) - t.end(name) - print(name,':', ':'.join(t.getTimeCost(name))) + t = TimeCost(name) + with t: + x = self._handle1(request) + print(name,':', 'time cost=', t.end_time = t.begin_time) return x async def _handle1(self,request:Request) -> StreamResponse: