mirror of
https://github.com/kopia/kopia.git
synced 2026-05-11 16:25:13 -04:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user