Skip to content

Commit

Permalink
add documentation for heroku node name
Browse files Browse the repository at this point in the history
  • Loading branch information
eprothro committed May 2, 2024
1 parent abcffec commit bc9d640
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
Note: 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") || :inet.gethostname() |> elem(1) |> List.to_string()
* 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 bc9d640

Please sign in to comment.