Skip to content

Commit

Permalink
Add documentation for heroku node name (#1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
eprothro committed May 2, 2024
1 parent abcffec commit 33c74ae
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions lib/oban.ex
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,20 @@ defmodule Oban do
## Node Name
When the `node` value hasn't been configured it is generated based on the environment:
When the `node` value has not been configured it is generated based on the environment:
1. If the local node is alive (e.g. in a distributed system, or when running from a mix release)
the node name is used
2. In a Heroku environment the system environment's `DYNO` value is used
3. Otherwise, the system hostname is used
When running a mix release on a Heroku node, the node is alive even if not part of a
distributed system. In order to use the `DYNO` value, configure the node value using runtime
configuration via `config/runtime.exs:
config :my_app, Oban,
node: System.get_env("DYNO", "nonode@nohost")
* In a distributed system the node name is used
* In a Heroku environment the system environment's `DYNO` value is used
* Otherwise, the system hostname is used
"""
@doc since: "0.1.0"
@spec start_link([option()]) :: Supervisor.on_start()
Expand Down

0 comments on commit 33c74ae

Please sign in to comment.