-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from mbuhot/feature/add_new_retrying_state_to_…
…state_machine Add new retry state to state machine
- Loading branch information
Showing
10 changed files
with
301 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defmodule EctoJob.Test.ExceptionJobQueue do | ||
# credo:disable-for-this-file | ||
|
||
use EctoJob.JobQueue, table_name: "jobs" | ||
|
||
def perform(_multi, _params) do | ||
raise "Exception" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
defmodule EctoJob.Test.JobQueue do | ||
# credo:disable-for-this-file | ||
|
||
@moduledoc false | ||
use EctoJob.JobQueue, table_name: "jobs" | ||
|
||
def perform(multi, params) do | ||
IO.inspect({multi, params}) | ||
def perform(multi, _params) do | ||
EctoJob.Test.Repo.transaction(multi) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
defmodule EctoJob.Test.TransactionFailJobQueue do | ||
# credo:disable-for-this-file | ||
|
||
use EctoJob.JobQueue, table_name: "jobs" | ||
|
||
def perform(multi, _params) do | ||
multi | ||
|> Ecto.Multi.run(:send, fn _,_ -> {:error, "Error"} end) | ||
|> EctoJob.Test.Repo.transaction() | ||
end | ||
end |
Oops, something went wrong.