Created
August 1, 2024 23:47
-
-
Save naramdash/4f06bf6e5223987705e466b6b230f75b to your computer and use it in GitHub Desktop.
is this code right?
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
let continuationAction (t: Task<int>) = | |
if not t.IsFaulted then | |
logger.Info( | |
"succ {@fetched} {@remained}", | |
[| messages.Length :> obj; queue.Count |] | |
) | |
else | |
logger.Error( | |
"error {@error}", | |
[| t.Exception.InnerExceptions.Count :> obj |] | |
) | |
messages |> Array.iter queue.Enqueue | |
Task.Delay(1000).Wait() | |
logger.Error( | |
"PIPE | AFTER_FAIL | QUE {0} | MSG {1}", | |
[| queue.Count :> obj; messages.Length |] | |
) | |
() | |
batch | |
.ExecuteNonQueryAsync() | |
.ContinueWith(continuationAction) | |
.PipeTo(context.Self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment