Logs: Improve purge log messages
This commit is contained in:
parent
bf0153267d
commit
2e6c907987
|
@ -144,7 +144,7 @@ func (w *CleanUp) Start(opt CleanUpOptions) (thumbs int, orphans int, err error)
|
|||
}
|
||||
} else {
|
||||
if err := query.PurgeOrphans(); err != nil {
|
||||
log.Errorf("index: %s (remove orphans)", err)
|
||||
log.Errorf("index: %s (purge orphans)", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/dustin/go-humanize/english"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/entity"
|
||||
"github.com/photoprism/photoprism/internal/query"
|
||||
)
|
||||
|
@ -34,9 +36,9 @@ func (w *Faces) Match(opt FacesOptions) (result FacesMatchResult, err error) {
|
|||
if opt.Force {
|
||||
log.Infof("faces: updating all markers")
|
||||
} else if unmatchedMarkers = query.CountUnmatchedFaceMarkers(); unmatchedMarkers > 0 {
|
||||
log.Infof("faces: %d unmatched markers", unmatchedMarkers)
|
||||
log.Infof("faces: found %s", english.Plural(unmatchedMarkers, "unmatched marker", "unmatched markers"))
|
||||
} else {
|
||||
log.Debugf("faces: no unmatched markers")
|
||||
log.Debugf("faces: found no unmatched markers")
|
||||
}
|
||||
|
||||
matchedAt := entity.TimePointer()
|
||||
|
@ -174,7 +176,7 @@ func (w *Faces) MatchFaces(faces entity.Faces, force bool, matchedBefore *time.T
|
|||
}
|
||||
}
|
||||
|
||||
log.Debugf("faces: matched %d markers", matched)
|
||||
log.Debugf("faces: matched %s", english.Plural(matched, "marker", "markers"))
|
||||
|
||||
if matched > max {
|
||||
break
|
||||
|
|
|
@ -261,7 +261,7 @@ func (w *Purge) Start(opt PurgeOptions) (purgedFiles map[string]bool, purgedPhot
|
|||
}
|
||||
} else {
|
||||
if err := query.PurgeOrphans(); err != nil {
|
||||
log.Errorf("index: %s (remove orphans)", err)
|
||||
log.Errorf("index: %s (purge orphans)", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@ func PurgeOrphans() error {
|
|||
if count, err := PurgeOrphanFiles(); err != nil {
|
||||
return err
|
||||
} else if count > 0 {
|
||||
log.Warnf("purge: removed %d orphan files [%s]", count, time.Since(start))
|
||||
log.Warnf("index: removed %d orphan files [%s]", count, time.Since(start))
|
||||
} else {
|
||||
log.Infof("purge: found no orphan files [%s]", time.Since(start))
|
||||
log.Infof("index: found no orphan files [%s]", time.Since(start))
|
||||
}
|
||||
|
||||
// Remove duplicates without an original file.
|
||||
|
|
Loading…
Reference in a new issue