Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ gem 'rack-timeout', require: false
gem 'readthis'
gem 'redacted_struct'
gem 'redis', '>= 3.2.0'
gem 'redis-namespace'
gem 'redis-session-store', '>= 0.11.3'
gem 'retries'
gem 'rotp', '~> 6.1'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ GEM
redis (>= 3.0, < 5.0)
redacted_struct (1.1.0)
redis (4.3.1)
redis-namespace (1.8.1)
redis (>= 3.0.4)
redis-session-store (0.11.3)
actionpack (>= 3, < 7)
redis (>= 3, < 5)
Expand Down Expand Up @@ -770,6 +772,7 @@ DEPENDENCIES
readthis
redacted_struct
redis (>= 3.2.0)
redis-namespace
redis-session-store (>= 0.11.3)
retries
rotp (~> 6.1)
Expand Down
5 changes: 4 additions & 1 deletion config/initializers/redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@
end

REDIS_POOL = ConnectionPool.new(size: 10) do
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

today this is only used in the (unlaunched in prod) RISC rate limiting, and that data is keys that expire every ~60 seconds, so there is no risk of data loss updating this now

Redis.new(url: IdentityConfig.store.redis_url)
Redis::Namespace.new(
'redis-pool',
redis: Redis.new(url: IdentityConfig.store.redis_url),
)
end
4 changes: 2 additions & 2 deletions spec/jobs/risc_delivery_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

RSpec.describe RiscDeliveryJob do
around do |ex|
REDIS_POOL.with { |r| r.flushdb }
REDIS_POOL.with { |namespaced| namespaced.redis.flushdb }
ex.run
REDIS_POOL.with { |r| r.flushdb }
REDIS_POOL.with { |namespaced| namespaced.redis.flushdb }
end

describe '#perform' do
Expand Down