Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06b4cc7
commit 2a62c83
Showing
7 changed files
with
36 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require 'dry/system/container' | ||
|
||
class Application < Dry::System::Container | ||
configure do |config| | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
require 'sidekiq-scheduler' | ||
|
||
Sidekiq.configure_server do |config| | ||
config.redis = REDIS | ||
config.redis = Application[:redis] | ||
end | ||
|
||
Sidekiq.configure_client do |config| | ||
config.redis = REDIS | ||
config.redis = Application[:redis] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Application.finalize(:redis) do |container| | ||
init do | ||
if Hanami.env?(:production) | ||
uri = URI.parse(ENV.fetch("REDISTOGO_URL")) | ||
redis = ConnectionPool.new(size: 10, timeout: 3) { Redis.new(driver: :hiredis, host: uri.host, port: uri.port, password: uri.password) } | ||
elsif Hanami.env?(:test) | ||
redis = ConnectionPool.new(size: 10, timeout: 3) { MockRedis.new } | ||
else | ||
redis = ConnectionPool.new(size: 10, timeout: 3) { Redis.new(host: 'localhost', port: 6379) } | ||
end | ||
|
||
container.register(:redis, redis) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'system/container' | ||
Import = Application.injector |