Skip to content

Commit

Permalink
Update rate limit threshold to less than 100
Browse files Browse the repository at this point in the history
  • Loading branch information
KangboLu authored Jun 11, 2020
1 parent c3bf476 commit 4945bf5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions request_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def build_url(params, access_token, ad_id):
def check_request_limit(response, ad_id):
current_rate_limit = json.loads(response.headers["x-business-use-case-usage"])[str(ad_id)][0]["call_count"]
print("current rate limit: " + str(current_rate_limit))
return current_rate_limit < 101
return current_rate_limit < 100

# make api request with given built urls
def api_request(url_list, url_start, country, group_id, ad_id):
Expand All @@ -88,8 +88,6 @@ def api_request(url_list, url_start, country, group_id, ad_id):

# make a request with specified params
response = requests.get(url_list[i])
print(response.headers)
print()

# extracting data in json format
data = json.loads(response.text)
Expand Down

0 comments on commit 4945bf5

Please sign in to comment.