Fix bug
This commit is contained in:
parent
57a6233779
commit
d0511f46c0
1 changed files with 17 additions and 14 deletions
|
@ -156,6 +156,7 @@ class SlowRequestMiddleware(object):
|
|||
start_time = time.time()
|
||||
response = self.get_response(request)
|
||||
if response.status_code == 200:
|
||||
try:
|
||||
response_time = time.time() - start_time
|
||||
url_name = resolve(request.path).url_name
|
||||
message = {
|
||||
|
@ -170,4 +171,6 @@ class SlowRequestMiddleware(object):
|
|||
logger_slow.info(json.dumps(message))
|
||||
if random.random() < 0.1:
|
||||
logger.info(json.dumps(message))
|
||||
except Exception:
|
||||
pass
|
||||
return response
|
||||
|
|
Loading…
Reference in a new issue