Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increment counter when request limit is reached #322

Merged
merged 6 commits into from
Oct 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Increment counter for http_api_request_limit_reached when request lim…
…it is reached.
  • Loading branch information
gudmdharalds committed Oct 24, 2022
commit 7d98ad78bf573cd67100a94923adb062e0465f45
6 changes: 6 additions & 0 deletions http-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,12 @@ function vipgoci_http_api_rate_limit_check(
( is_numeric( $resp_headers['x-ratelimit-remaining'][0] ) ) &&
( $resp_headers['x-ratelimit-remaining'][0] <= 1 )
) {
vipgoci_counter_report(
VIPGOCI_COUNTERS_DO,
'http_api_request_limit_reached',
1
);

vipgoci_sysexit(
'Exceeded rate limit for HTTP API, unable to ' .
'continue without making further requests.',
Expand Down