Skip to content

Commit 785baa8

Browse files
committed
Continue if x-ratelimit-remaining header is missing
1 parent 7188d40 commit 785baa8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

devstats/query.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ def send_query(query, query_type, headers, cursor=None):
107107
# Success
108108
retries = 0
109109

110-
rate_limit = {h: response.headers[h] for h in ("x-ratelimit-remaining",)}
110+
rate_limit = {
111+
h: response.headers[h]
112+
for h in ("x-ratelimit-remaining",)
113+
if h in response.headers
114+
}
111115
return {**data, **rate_limit}
112116

113117

0 commit comments

Comments
 (0)