diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/config.exs | 4 | ||||
-rw-r--r-- | config/runtime.exs | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/config/config.exs b/config/config.exs index ef3c828..15cde18 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,9 +1,5 @@ import Config -# This will be redis when scaled across multiple nodes -config :hammer, - backend: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]} - config :chessh, ecto_repos: [Chessh.Repo], key_dir: Path.join(Path.dirname(__DIR__), "priv/keys"), diff --git a/config/runtime.exs b/config/runtime.exs index 5c741ff..f3cc03c 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -1,5 +1,20 @@ import Config +config :hammer, + backend: [ + in_memory: + {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}, + redis: + {Hammer.Backend.Redis, + [ + expiry_ms: 60_000 * 60 * 2, + redix_config: [ + host: System.get_env("REDIS_HOST", "localhost"), + port: String.to_integer(System.get_env("REDIS_PORT", "6379")) + ] + ]} + ] + config :chessh, port: String.to_integer(System.get_env("SSH_PORT", "42069")) |