Created
January 12, 2015 12:55
-
-
Save JonCanning/78f6d5c651db5a5ad57a to your computer and use it in GitHub Desktop.
retry
This file contains hidden or 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
| let retry f = | |
| let rec innerRetry f i = | |
| try | |
| f() | |
| with | |
| | ex when i > 0 -> | |
| Syslog.Error ex | |
| Syslog.Info("Retry no {0}", (i - 5) * -1) | |
| Async.Sleep 1000 |> Async.RunSynchronously | |
| innerRetry f <| i - 1 | |
| | ex -> raise ex | |
| innerRetry f 4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment