Skip to content

Commit

Permalink
Include all fields in Job.t/0 unique spec
Browse files Browse the repository at this point in the history
The unique spec lacked `keys` and `timestamp` fields.
  • Loading branch information
sorentwo committed Jun 25, 2024
1 parent 7be64ef commit d3e6baf
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/oban/job.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ defmodule Oban.Job do
| :scheduled
]

@type unique_timestamp :: :inserted_at | :scheduled_at

@type unique_option ::
{:fields, [unique_field()]}
| {:keys, [atom()]}
| {:period, unique_period()}
| {:states, [unique_state()]}
| {:timestamp, :inserted_at | :scheduled_at}
| {:timestamp, unique_timestamp()}

@type replace_option :: [
:args
Expand Down Expand Up @@ -111,7 +113,14 @@ defmodule Oban.Job do
conflict?: boolean(),
replace: [replace_option() | replace_by_state_option()] | nil,
unique:
%{fields: [unique_field()], period: unique_period(), states: [unique_state()]} | nil,
%{
fields: [unique_field()],
keys: [atom()],
period: unique_period(),
states: [unique_state()],
timestamp: unique_timestamp()
}
| nil,
unsaved_error:
%{
kind: Exception.kind(),
Expand Down

0 comments on commit d3e6baf

Please sign in to comment.