Over 1200 API call limit not reset after 5 minutes

Created on 23 August 2024, 3 months ago
Updated 29 August 2024, 3 months ago

Problem/Motivation

After the Cloudflare 5 minute rate limit is exceeded, the API call count does not get reset after 5 minutes has passed. It stays at 1200, and no further Cloudflare purges are possible.

Steps to reproduce

  1. In a test environment, exceed the 5 minute API call limit. You can do this by setting the Drupal State variable, cloudflare_api_rate_count, to 1200. See that further attempts to purge result in logging the error, "ERROR: CloudFlare - Api Rate limit check.: Exceeded Api limit of 1200/1200 every 5 minutes."
  2. In the Admin UI, go to Configuration -> Development -> Performance -> Purge
  3. Expand "Queue" on the left.
  4. Under the "Queue" column, click the dropdown for "Database".
  5. Select "Empty" and confirm that you want to empty the queue.
  6. Do some actions on the site that will result in queueing more purge items.
  7. Wait 5 minutes, and run purge again. See that your newly queued items have not been processed. Instead you continue to see the "Exceeded Api limit of 1200/1200 limit" message logged.

Proposed resolution

Find out where the cloudflarepurger submodule determines whether or not to reset the 5-minute API count, debug, and fix the logic. Then submit a patch.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States anthonyf

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024