• Sean McGivern's avatar
    Use rate limiting Redis for Rack::Attack · 1c3b893f
    Sean McGivern authored
    To control this, we use an environment variable. This is because
    Rack::Attack is configured in an initialiser, so a feature flag is of
    minimal value - it would still need a restart to take effect.
    
    We could rewrite the InstrumentedCacheStore to allow changing the store
    on a per-operation basis, but that adds more risk for what should be a
    quick migration. It would also add a feature flag check in a very hot
    code path (rate limiting checks happen multiple times on every request).
    1c3b893f
instrumented_cache_store.rb 1.74 KB