Once daily limit is hit, it never resets

Created on 31 July 2019, over 5 years ago
Updated 9 June 2023, over 1 year ago

The same method (incrementTagPurgeDailyCount) is used to both increment the daily purge count, and to reset it if it is a new day. The issue here is that once the daily limit is hit, this function is never allowed to be called again since diagnostics will block the purger from running. I propose that we separate these actions into two separate methods. We should only call the increment method when a purge is successful (how it's currently setup), and the new method to check the date and potentially reset the counter should only be called in the diagnostic check.

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇺🇸United States Mike.Conley

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇺🇸United States charginghawk

    FYI, this can happen with the API rate limit too. If you somehow go over the rate limit by a couple of items, it gets stuck and you get messages like "diagnostics: ERROR: CloudFlare - Api Rate limit check.: Exceeded Api limit of 1203/1200 limit purges/day" or "diagnostics: ERROR: CloudFlare - Api Rate limit check.: Exceeded Api limit of 1202/1200 limit purges/day." You can get these errors for every page load if late runtime processor is enabled. (Also there's a typo, it should say "1200 limit purges/5 min".) You can run this to reset the API rate:

    drush eval '\Drupal::service("cloudflare.state")->incrementApiRateCount();'
    
  • 🇳🇿New Zealand RoSk0 Wellington

    Crosslinking.

  • First commit to issue fork.
  • 🇩🇪Germany SteffenR Germany

    Just checked the latest 2.0.x-dev release.
    The changes are already applied. Sorry for the new branches accidently created (they can be deleted)..

  • 🇮🇳India tdnshah

    I was facing the issue with API rate limit as mentioned in #13 and running the drush command drush eval '\Drupal::service("cloudflare.state")->incrementApiRateCount();' as shared by @charginghawk did reset the API rate Thank you @charginghawk for sharing the same.

    @SteffenR as mention that this things are covered and fixed in 2.0.x-dev release branch does it also resolved the issue for API Rate limit or should we create another issue for the same and create patch against 2.0.x-dev branch?

    Thank you

Production build 0.71.5 2024