Commit Graph

8 Commits

Author SHA1 Message Date
Sojan Jose
abe22c8649 fix: Rack-attack disable double Redis pooling (#11545)
Rails 7.1 ships with connection-pooling enabled by default for
`RedisCacheStore` (see rails/rails#45235).
Because we already wrap our Redis clients in our own `ConnectionPool`
($alfred / $velma), the upgrade resulted in a double-wrapped object and
runtime errors such as:

NoMethodError: undefined method `get` for an instance of ConnectionPool

This patch:

* Passes `pool: false` when instantiating `RedisCacheStore` in
`config/initializers/rack_attack.rb`, telling Rails to use the pool we
supply instead of building its own.
* Adds an inline comment explaining the rationale.
* Adds a TODO in `config/initializers/01_redis.rb` suggesting a future
simplification: switch to plain Redis clients and let Rails manage the
pool.

Reference docs:
* rails/rails#45235 – “Enable connection pooling by default for
MemCacheStore and RedisCacheStore” -
https://github.com/rails/rails/pull/45235
* Rails 7.1 Caching Guide – 2.1.1 “Connection Pool Options” (use `pool:
false`) [Ruby on Rails
Guides](https://guides.rubyonrails.org/v7.1/caching_with_rails.html)
2025-05-21 20:00:11 -07:00
Sojan Jose
022383d942 chore: Upgrade to Rails 7 (#6719)
fixes: #6736
2023-05-06 10:44:52 +05:30
Sojan Jose
269ad8f697 Fix: Errors in Heroku deployments (#6182)
Due to 86ca7f4a8d the redis configuration in Heroku deployments was breaking, temporarily reverting the part until we identify a fix.

fixes: #5938
2023-01-05 18:36:21 +05:30
Sojan Jose
8b659de73d chore: Use connection_pool for redis (#5790)
fixes: #3199
2022-11-02 17:31:20 -07:00
Arkadiy Ayvazyan
86ca7f4a8d fix: Autoloading during initialization deprecation warning (#5628)
Autoloading during initialization deprecation warning fix
fixes: #4012
2022-11-01 20:19:42 -07:00
Stephen Paul Weber
f2753df8df chore: Use multiple connections in Redis connection pool (#5574)
- The initializer set up a connection pool, but both pools created namespace wrappers around a single global connection. Splitting them up.
2022-11-01 16:49:26 -07:00
Manoj M J
2c8bf00d38 chore: Use connection pooling for Redis
ref: #3199
2021-10-11 19:46:15 +05:30
Sojan Jose
b44f9b792b chore: Block & throttle abusive requests (#2706)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2021-07-27 21:27:23 +05:30