Add timeout on example client.

This commit is contained in:
Tom Wilkie
2015-06-24 11:07:35 +00:00
parent 5e4cfc57e5
commit bd4556f6c3

View File

@@ -6,17 +6,18 @@ import logging
import sys
app = 'http://app:5000/'
concurrency = 1
concurrency = 2
def do_requests():
s = requests.Session()
while True:
try:
s.get(app)
s.get(app, timeout=1.0)
logging.info("Did request")
time.sleep(1)
except:
logging.error("Error doing request", exc_info=sys.exc_info())
time.sleep(1)
logging.info("Did request")
def main():