Skip to content

Commit a2284fb

Browse files
srzeszutkraleppa
authored andcommitted
Feature: Allow configuring endpoint drainer (#933)
* add posibility to change drainer from config
1 parent 17984bf commit a2284fb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

docs/config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ config :live_debugger,
9494
signing_salt: "your_signing_salt", # Signing salt used for LiveDebugger.Endpoint
9595
adapter: Bandit.PhoenixAdapter, # Adapter used in LiveDebugger.Endpoint
9696
server: true, # Forces LiveDebugger to start even if project is not started with the `mix phx.server`
97+
drainer: [shutdown: 1000] # Wait a maximum of 1000ms before forcefully terminating connections. You can also switch it off with `false`.
98+
9799

98100
# Name for LiveDebugger PubSub (it will create new one so don't put already used name)
99101
config :live_debugger, :pubsub_name, LiveDebugger.CustomPubSub

lib/live_debugger.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ defmodule LiveDebugger do
1414
@default_port 4007
1515
@default_secret_key_base "DEFAULT_SECRET_KEY_BASE_1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcd"
1616
@default_signing_salt "live_debugger_signing_salt"
17+
@default_drainer [shutdown: 1000]
1718

1819
@js_path "assets/live_debugger/client.js"
1920
@css_path "assets/live_debugger/client.css"
@@ -67,7 +68,8 @@ defmodule LiveDebugger do
6768
secret_key_base: Keyword.get(config, :secret_key_base, @default_secret_key_base),
6869
live_view: [signing_salt: Keyword.get(config, :signing_salt, @default_signing_salt)],
6970
adapter: Keyword.get(config, :adapter, default_adapter()),
70-
live_reload: Keyword.get(config, :live_reload, [])
71+
live_reload: Keyword.get(config, :live_reload, []),
72+
drainer: Keyword.get(config, :drainer, @default_drainer)
7173
]
7274

7375
endpoint_server = Keyword.get(config, :server)

0 commit comments

Comments
 (0)