mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Index: Improve limit checks and logging #3227
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -65,6 +65,7 @@ func StartIndexing(router *gin.RouterGroup) {
|
||||
lastRun := ind.LastRun()
|
||||
indexStart := time.Now()
|
||||
found, updated := ind.Start(indOpt)
|
||||
updateMoments := updated > 0 || lastRun.IsZero()
|
||||
|
||||
log.Infof("index: updated %s [%s]", english.Plural(updated, "file", "files"), time.Since(indexStart))
|
||||
|
||||
@@ -85,10 +86,11 @@ func StartIndexing(router *gin.RouterGroup) {
|
||||
return
|
||||
} else if len(files) > 0 || len(photos) > 0 {
|
||||
event.InfoMsg(i18n.MsgRemovedFilesAndPhotos, len(files), len(photos))
|
||||
updateMoments = true
|
||||
}
|
||||
|
||||
// Update moments?
|
||||
if updated > 0 || lastRun.IsZero() {
|
||||
if updateMoments {
|
||||
event.Publish("index.updating", event.Data{
|
||||
"step": "moments",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user