Skip to content

Commit

Permalink
Tweak README to reflect conflict? flag changes (#1092)
Browse files Browse the repository at this point in the history
Since `Oban.insert` changed its behaviour regarding the conflict?
when failing to acquire the respective advisory lock the README should
reflect that.
  • Loading branch information
elridion committed May 28, 2024
1 parent 433b8aa commit 5e2cd17
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,15 @@ otherwise it is `false`.
You can use the `:conflict?` field to customize responses after insert:

```elixir
with {:ok, %Job{conflict?: true}} <- Oban.insert(changeset) do
{:error, :job_already_exists}
case Oban.insert(changeset) do
{:ok, %Job{id: nil, conflict?: true}} ->
{:error, :failed_to_acquire_lock}

{:ok, %Job{conflict?: true}} ->
{:error, :job_already_exists}

result ->
result
end
```

Expand Down

0 comments on commit 5e2cd17

Please sign in to comment.