-
Notifications
You must be signed in to change notification settings - Fork 5
Auto commit after timeout #401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7fb6112 to
05e938c
Compare
adrienaury
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK to publish a "-beta1" version for now
|
|
||
| committed := make([]Row, 0, commitSize) | ||
|
|
||
| // Handle savepoint on exit | ||
| defer func() { | ||
| if savepointPath != "" { | ||
| if err := savepoint(savepointPath, committed); err != nil { | ||
| log.Error().Msgf("Savepoint failure, %d lines committed unsaved", len(committed)) | ||
| for _, unsaved := range committed { | ||
| if ctx.cfg.SavepointPath != "" { | ||
| if err := savepoint(ctx.cfg.SavepointPath, ctx.committed); err != nil { | ||
| log.Error().Msgf("Savepoint failure, %d lines committed unsaved", len(ctx.committed)) | ||
| for _, unsaved := range ctx.committed { | ||
| log.Warn().Interface("value", unsaved).Msg("Unsaved committed value") | ||
| } | ||
| } | ||
| } | ||
| }() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see commited variable was moved under the ctx execution context.
What happen if the ctx.Run method is called multiple times ? can it create problems because commited var is not cleaned betweens multiples calls ? does it happens ?
No description provided.