Skip to content

Instantly share code, notes, and snippets.

@rishiloyola
Created June 5, 2016 07:29
Show Gist options
  • Save rishiloyola/d1f06e59295ad4e57f0e75951fb19d13 to your computer and use it in GitHub Desktop.
Save rishiloyola/d1f06e59295ad4e57f0e75951fb19d13 to your computer and use it in GitHub Desktop.
func (a *Appbase) commitBulk(commitNow bool) {
if a.bulkBodySize >= a.bulkSize || a.bulkService.NumberOfActions() >= APPBASE_BUFFER_LEN || commitNow {
a.count += a.bulkService.NumberOfActions()
_, err := a.bulkService.Do()
if err != nil {
a.pipe.Err <- NewError(CRITICAL, a.path, fmt.Sprintf("appbase error (%s)", err), nil)
a.pipe.Stop()
}
a.bulkBodySize = 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment