diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/dev.exs | 7 | ||||
-rw-r--r-- | config/runtime.exs | 30 | ||||
-rw-r--r-- | config/test.exs | 7 |
3 files changed, 29 insertions, 15 deletions
diff --git a/config/dev.exs b/config/dev.exs index 88ee30b..f37da7b 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -5,3 +5,10 @@ config :chessh, Chessh.Repo, username: "postgres", password: "postgres", hostname: "localhost" + +config :hammer, + backend: [ + in_memory: + {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}, + redis: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]} + ] diff --git a/config/runtime.exs b/config/runtime.exs index f3cc03c..832dc95 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -1,20 +1,5 @@ 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")) @@ -43,4 +28,19 @@ if config_env() == :prod do url: database_url, pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10"), socket_options: maybe_ipv6 + + 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", "redis"), + port: String.to_integer(System.get_env("REDIS_PORT", "6379")) + ] + ]} + ] end diff --git a/config/test.exs b/config/test.exs index 3319f9b..60b42be 100644 --- a/config/test.exs +++ b/config/test.exs @@ -11,6 +11,13 @@ config :chessh, Chessh.Repo, hostname: "localhost", pool: Ecto.Adapters.SQL.Sandbox +config :hammer, + backend: [ + in_memory: + {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}, + redis: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]} + ] + config :chessh, port: 34_355, key_dir: Path.join(Path.dirname(__DIR__), "priv/test_keys") |