mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Use gevent.sleep to make the program non-blocking
This commit is contained in:
+2
-1
@@ -11,6 +11,7 @@ import base64
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
import gevent
|
||||
|
||||
import newrelic.agent
|
||||
|
||||
@@ -307,7 +308,7 @@ def delay_response(delay):
|
||||
"""Returns a delayed response"""
|
||||
delay = min(delay, 10)
|
||||
|
||||
time.sleep(delay)
|
||||
gevent.sleep(delay)
|
||||
|
||||
return jsonify(get_dict(
|
||||
'url', 'args', 'form', 'data', 'origin', 'headers', 'files'))
|
||||
|
||||
Reference in New Issue
Block a user