Add indefiniteDefaults

This commit is contained in:
Domen Kožar 2024-01-23 13:21:55 +00:00
parent d24f05288b
commit 5f65932602

View File

@ -7,6 +7,7 @@ module Stamina
-- types
RetrySettings (..),
defaults,
indefiniteDefaults,
RetryAction (..),
RetryStatus (..),
-- raising exceptions
@ -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.