Skip to content

Commit ad0aca9

Browse files
committed
config/Add redis
1 parent 735a0f7 commit ad0aca9

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ gem 'byebug'
2525
gem 'devise'
2626
gem "aws-sdk-s3", require: false
2727
gem 'will_paginate', '~> 3.1.0'
28+
gem 'redis'
2829

2930
# Use Redis adapter to run Action Cable in production
3031
# gem 'redis', '~> 4.0'

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ GEM
169169
rb-fsevent (0.10.3)
170170
rb-inotify (0.10.1)
171171
ffi (~> 1.0)
172+
redis (4.2.5)
172173
responders (3.0.0)
173174
actionpack (>= 5.0)
174175
railties (>= 5.0)
@@ -234,6 +235,7 @@ DEPENDENCIES
234235
pg (>= 0.18, < 2.0)
235236
puma (~> 4.1)
236237
rails (~> 6.0.2, >= 6.0.2.2)
238+
redis
237239
sass-rails (>= 6)
238240
spring
239241
spring-watcher-listen (~> 2.0.0)

config/initializers/redis.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if Rails.env.production?
2+
uri = URI.parse(ENV["REDISTOGO_URL"])
3+
else
4+
uri = URI.parse("redis://localhost:6379")
5+
end
6+
7+
REDIS = Redis.new(:url => uri)

0 commit comments

Comments
 (0)