Add a 3 second sleep to Ask OpenStack call

Ask OpenStack has been going down hard during cron time.
For debugging purposes, add a 3 second sleep between calls
to the Ask OpenStack API in the UC recognition script.

Change-Id: Ie5c62d48f6972e2206916c585ffc3bb69b3b23ad
This commit is contained in:
Tom Fifield 2017-02-14 16:05:09 +08:00
parent 34f4c5304c
commit b23851253a
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,7 @@
import datetime
import json
import requests
import time
user_list = 'https://ask.openstack.org/en/api/v1/users/'
@ -44,6 +44,7 @@ def get_user_data(karma_level):
print "Getting page: %d" % page
response = session.get(user_list, params=params)
user_data.extend(json.loads(response.text)['users'])
time.sleep(3)
# since pages are big chunks, we will have some users that are
# having karma lower than karma_level in the last page. Remove them.