check: Add stats showing total files matched.
This commit is contained in:
parent
d08453d402
commit
7782eda88e
3 changed files with 36 additions and 10 deletions
|
@ -577,6 +577,7 @@ type checkMarch struct {
|
|||
noHashes int32
|
||||
srcFilesMissing int32
|
||||
dstFilesMissing int32
|
||||
matches int32
|
||||
}
|
||||
|
||||
// DstOnly have an object which is in the destination only
|
||||
|
@ -644,6 +645,7 @@ func (c *checkMarch) Match(dst, src fs.DirEntry) (recurse bool) {
|
|||
if differ {
|
||||
atomic.AddInt32(&c.differences, 1)
|
||||
} else {
|
||||
atomic.AddInt32(&c.matches, 1)
|
||||
fs.Debugf(dstX, "OK")
|
||||
}
|
||||
if noHash {
|
||||
|
@ -711,6 +713,9 @@ func CheckFn(fdst, fsrc fs.Fs, check checkFn, oneway bool) error {
|
|||
if c.noHashes > 0 {
|
||||
fs.Logf(fdst, "%d hashes could not be checked", c.noHashes)
|
||||
}
|
||||
if c.matches > 0 {
|
||||
fs.Logf(fdst, "%d matching files", c.matches)
|
||||
}
|
||||
if c.differences > 0 {
|
||||
return errors.Errorf("%d differences found", c.differences)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue