Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

loader: fix load progress #89

Merged
merged 1 commit into from
Mar 23, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ func (l *Loader) IsFreshTask() (bool, error) {

// Restore begins the restore process.
func (l *Loader) Restore(ctx context.Context) error {
// reset some counter used to calculate progress
l.totalDataSize.Set(0)
l.finishedDataSize.Set(0) // reset before load from checkpoint

if err := l.prepare(); err != nil {
log.Errorf("[loader] scan dir[%s] failed, err[%v]", l.cfg.Dir, err)
return errors.Trace(err)
Expand Down