Set nicer Redis defaults for dev environment

In Staging and Production we have two Redis instances running on two different ports. In dev that probably won't be set up, and Redis will be on port 6379 by default. These defaults mean it will work nicely out of the box.
This commit is contained in:
Matt-Yorkley
2021-06-09 18:32:24 +01:00
parent 083f512aae
commit 12f7e2d685
2 changed files with 3 additions and 1 deletions

View File

@@ -3,3 +3,5 @@
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
OFN_REDIS_URL="redis://localhost:6379/1"
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"

View File

@@ -14,7 +14,7 @@ Openfoodnetwork::Application.configure do
if !!ENV["PROFILE"]
config.cache_store = :redis_cache_store, {
driver: :hiredis,
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6379/0"),
url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6379/1"),
expires_in: 90.minutes
}
end