Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds Oban by default to
phx.new
with the following considerations:use Oban
, to generate a dedicatedMyApp.Oban
module for the application. This makes configuration in the application clearer and more familiar, because it matchesMyApp.Repo
. This would also allow multiple apps in an umbrella to have their own Oban instances without any name conflicts.Postgres
orSQLite3
. Creating a new project with other, currently unsupported, databases won't include Oban. This is documented in the task help.default
queue, a pruning plugin set to retain jobs for one hour, and an empty crontab to indicate that periodic jobs are available.DataCase
.Questions
MyApp.Oban
) approach alright with others? It's newer, and officially supported for several versions now, but it isn't what the installation docs prescribe.0
, rather than a timestamp just to get it working. Any thoughts or suggestions on how to get the correctly named file, or whether a different hard-coded number may work?It Works!
Here's a screenshot after running
mix phx.new my_app; mix ecto.reset; iex -S mix phx.server
and checking that Oban is up and running: