Skip to content

Commit

Permalink
Continue if x-ratelimit-remaining header is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanv committed Nov 19, 2024
1 parent 7188d40 commit 785baa8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion devstats/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def send_query(query, query_type, headers, cursor=None):
# Success
retries = 0

rate_limit = {h: response.headers[h] for h in ("x-ratelimit-remaining",)}
rate_limit = {
h: response.headers[h]
for h in ("x-ratelimit-remaining",)
if h in response.headers
}
return {**data, **rate_limit}


Expand Down

0 comments on commit 785baa8

Please sign in to comment.