Skip to content

Commit

Permalink
Add indefiniteDefaults
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Jan 23, 2024
1 parent d24f052 commit 5f65932
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Stamina.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Stamina
-- types
RetrySettings (..),
defaults,
indefiniteDefaults,
RetryAction (..),
RetryStatus (..),
-- raising exceptions
Expand Down Expand Up @@ -75,6 +76,13 @@ defaults =
backoffExpBase = 2.0
}

indefiniteDefaults :: RetrySettings
indefiniteDefaults =
defaults
{ maxTime = Nothing,
maxAttempts = Nothing
}

data RetryAction
= RaiseException -- Propagate the exception.
| Retry -- Retry with the delay according to the settings.
Expand Down

0 comments on commit 5f65932

Please sign in to comment.