mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
Python requests only does keep alive within a session...
This commit is contained in:
@@ -8,9 +8,10 @@ pyapps = ['http://pyapp:5000/']
|
||||
concurrency = 5
|
||||
|
||||
def do_requests():
|
||||
s = requests.Session()
|
||||
while True:
|
||||
try:
|
||||
requests.get(random.choice(pyapps))
|
||||
s.get(random.choice(pyapps))
|
||||
except:
|
||||
logging.error("Error doing request", exc_info=sys.exc_info())
|
||||
logging.info("Did request")
|
||||
|
||||
@@ -42,4 +42,4 @@ def hello():
|
||||
return result
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0", debug=True)
|
||||
app.run(host="0.0.0.0", port=5000, debug=True)
|
||||
|
||||
Reference in New Issue
Block a user