Skip to content

Instantly share code, notes, and snippets.

@naramdash
Created August 1, 2024 23:47
Show Gist options
  • Save naramdash/4f06bf6e5223987705e466b6b230f75b to your computer and use it in GitHub Desktop.
Save naramdash/4f06bf6e5223987705e466b6b230f75b to your computer and use it in GitHub Desktop.
is this code right?
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