From 12f7e2d685a6882aee582cea17615c95d4f44fe7 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 9 Jun 2021 18:32:24 +0100 Subject: [PATCH] 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. --- .env.development | 2 ++ config/environments/development.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.development b/.env.development index f365aa5e41..3e3f4202ef 100644 --- a/.env.development +++ b/.env.development @@ -3,3 +3,5 @@ SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +OFN_REDIS_URL="redis://localhost:6379/1" +OFN_REDIS_JOBS_URL="redis://localhost:6379/2" diff --git a/config/environments/development.rb b/config/environments/development.rb index 89d7854fe1..2cf1818c6c 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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