From 5e2cd17a28e457956f2ab6b7000746a59d673b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20G=C3=B6deke?= Date: Tue, 28 May 2024 18:59:28 +0200 Subject: [PATCH] Tweak README to reflect conflict? flag changes (#1092) Since `Oban.insert` changed its behaviour regarding the conflict? when failing to acquire the respective advisory lock the README should reflect that. --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d3dce4a..88159402 100644 --- a/README.md +++ b/README.md @@ -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 ```