mirror of
https://github.com/ash-project/ash_oban.git
synced 2024-09-19 21:03:00 +12:00
improvement: add args
option for setting custom job arguments
This commit is contained in:
parent
4a8bee4bd1
commit
ce079229ec
1 changed files with 3 additions and 0 deletions
|
@ -439,6 +439,7 @@ defmodule AshOban do
|
|||
## Options
|
||||
|
||||
- `:actor` - the actor to set on the job. Requires configuring an actor persister.
|
||||
- `:args` - additional arguments to merge into the job's arguments map.
|
||||
|
||||
All other options are passed through to `c:Oban.Worker.new/2`
|
||||
"""
|
||||
|
@ -454,6 +455,7 @@ defmodule AshOban do
|
|||
## Options
|
||||
|
||||
- `:actor` - the actor to set on the job. Requires configuring an actor persister.
|
||||
- `:args` - additional arguments to merge into the job's arguments map.
|
||||
|
||||
All other options are passed through to `c:Oban.Worker.new/2`
|
||||
"""
|
||||
|
@ -485,6 +487,7 @@ defmodule AshOban do
|
|||
metadata: metadata
|
||||
}
|
||||
|> AshOban.store_actor(opts[:actor])
|
||||
|> then(&Map.merge(opts[:args] || %{}, &1))
|
||||
|> trigger.worker.new(oban_job_opts)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue