fs: improve log output when no changes are made - fixes #3454

- changes a few log messages to debug level
- adds a log message for when 0 bytes are transferred
This commit is contained in:
Tim Gallant 2020-02-09 11:30:41 -08:00 committed by Nick Craig-Wood
parent 5c869d5bd3
commit 1d73f071f6
2 changed files with 9 additions and 5 deletions

View File

@ -640,7 +640,7 @@ func DeleteFilesWithBackupDir(ctx context.Context, toBeDeleted fs.ObjectsChan, b
} }
}() }()
} }
fs.Infof(nil, "Waiting for deletions to finish") fs.Debugf(nil, "Waiting for deletions to finish")
wg.Wait() wg.Wait()
if errorCount > 0 { if errorCount > 0 {
err := errors.Errorf("failed to delete %d files", errorCount) err := errors.Errorf("failed to delete %d files", errorCount)
@ -872,7 +872,7 @@ func CheckFn(ctx context.Context, fdst, fsrc fs.Fs, check checkFn, oneway bool)
Dir: "", Dir: "",
Callback: c, Callback: c,
} }
fs.Infof(fdst, "Waiting for checks to finish") fs.Debugf(fdst, "Waiting for checks to finish")
err := m.Run() err := m.Run()
if c.dstFilesMissing > 0 { if c.dstFilesMissing > 0 {

View File

@ -345,7 +345,7 @@ func (s *syncCopyMove) startCheckers() {
// This stops the background checkers // This stops the background checkers
func (s *syncCopyMove) stopCheckers() { func (s *syncCopyMove) stopCheckers() {
s.toBeChecked.Close() s.toBeChecked.Close()
fs.Infof(s.fdst, "Waiting for checks to finish") fs.Debugf(s.fdst, "Waiting for checks to finish")
s.checkerWg.Wait() s.checkerWg.Wait()
} }
@ -360,7 +360,7 @@ func (s *syncCopyMove) startTransfers() {
// This stops the background transfers // This stops the background transfers
func (s *syncCopyMove) stopTransfers() { func (s *syncCopyMove) stopTransfers() {
s.toBeUploaded.Close() s.toBeUploaded.Close()
fs.Infof(s.fdst, "Waiting for transfers to finish") fs.Debugf(s.fdst, "Waiting for transfers to finish")
s.transfersWg.Wait() s.transfersWg.Wait()
} }
@ -381,7 +381,7 @@ func (s *syncCopyMove) stopRenamers() {
return return
} }
s.toBeRenamed.Close() s.toBeRenamed.Close()
fs.Infof(s.fdst, "Waiting for renames to finish") fs.Debugf(s.fdst, "Waiting for renames to finish")
s.renamerWg.Wait() s.renamerWg.Wait()
} }
@ -756,6 +756,10 @@ func (s *syncCopyMove) run() error {
// Read the error out of the context if there is one // Read the error out of the context if there is one
s.processError(s.ctx.Err()) s.processError(s.ctx.Err())
if accounting.Stats(s.ctx).GetTransfers() == 0 {
fs.Infof(nil, "There was nothing to transfer")
}
// cancel the context to free resources // cancel the context to free resources
s.cancel() s.cancel()
return s.currentError() return s.currentError()