• 
      

    Fix the expiration time for ratelimit caching.

    Review Request #15045 — Created May 12, 2026 and submitted

    Information

    Djblets
    release-6.x

    Reviewers

    When adding the initial count for a rate limit window in cache, the
    expiration was being set based on the window value, which was too large
    to be accepted by the cache backend, being a UNIX timestamp and not a
    number of seconds in the future. This resulted in the add failing.

    We now use the number of seconds remaining + 60 instead, which isn't
    exactly the same but gives us a suitable expiration with a buffer built
    in.

    Tested this build in production and verified it fixed the rate limit
    caching.

    Summary ID
    Fix the expiration time for ratelimit caching.
    When adding the initial count for a rate limit window in cache, the expiration was being set based on the window value, which was too large to be accepted by the cache backend, being a UNIX timestamp and not a number of seconds in the future. This resulted in the add failing. We now use the number of seconds remaining + 60 instead, which isn't exactly the same but gives us a suitable expiration with a buffer built in.
    386a88815cb16724cad96bd96428a9ae072a4eee
    david
    1. Ship It!
    2. 
        
    chipx86
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-6.x (21fb1fb)