Fixed checkpointing to not restart the entire upload process (#594)

* object: added Checkpoint() method to object writer

* upload: refactored code structure to allow better checkpointing

* upload: removed Checkpoint() method from UploadProgress

* Update fs/entry.go

Co-authored-by: Julio López <julio+gh@kasten.io>
This commit is contained in:
Jarek Kowalski
2020-09-12 22:36:22 -07:00
committed by GitHub
parent 6a14ac8a2a
commit f0b97b960b
10 changed files with 556 additions and 221 deletions

View File

@@ -89,24 +89,6 @@ func (p *cliProgress) CachedFile(fname string, numBytes int64) {
p.maybeOutput()
}
func (p *cliProgress) Checkpoint() {
p.output(noticeColor, "Saving a checkpoint...\n")
if p.shared {
// do not reset counters
return
}
*p = cliProgress{
uploading: 1,
uploadStartTime: clock.Now(),
previousFileCount: p.previousFileCount,
previousTotalSize: p.previousTotalSize,
uploadedBytes: p.uploadedBytes,
uploadedFiles: p.uploadedFiles,
}
}
func (p *cliProgress) maybeOutput() {
if atomic.LoadInt32(&p.uploading) == 0 {
return