Logs: Reduce severity from error to warning when indexer is busy

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2023-09-20 21:11:51 +02:00
parent ce4cb6bd47
commit 2843342d00
5 changed files with 5 additions and 5 deletions

View file

@ -77,7 +77,7 @@ func (imp *Import) Start(opt ImportOptions) fs.Done {
// Make sure to run import only once, unless otherwise requested.
if !opt.NonBlocking {
if err := mutex.MainWorker.Start(); err != nil {
event.Error(fmt.Sprintf("import: %s", err.Error()))
event.Warn(fmt.Sprintf("import: %s", err.Error()))
return done
}

View file

@ -101,7 +101,7 @@ func (ind *Index) Start(o IndexOptions) (found fs.Done, updated int) {
}
if err := mutex.MainWorker.Start(); err != nil {
event.Error(fmt.Sprintf("index: %s", err.Error()))
event.Warn(fmt.Sprintf("index: %s", err.Error()))
return found, updated
}

View file

@ -53,7 +53,7 @@ func (w *Moments) Start() (err error) {
}
}()
if err := mutex.MainWorker.Start(); err != nil {
if err = mutex.MainWorker.Start(); err != nil {
return err
}

View file

@ -37,7 +37,7 @@ func (w *Places) Start() (updated []string, err error) {
}()
// Check if a worker is already running.
if err := mutex.MainWorker.Start(); err != nil {
if err = mutex.MainWorker.Start(); err != nil {
log.Warnf("index: %s (update locations)", err.Error())
return []string{}, err
}

View file

@ -59,7 +59,7 @@ func (w *Purge) Start(opt PurgeOptions) (purgedFiles map[string]bool, purgedPhot
purgedFiles = make(map[string]bool)
purgedPhotos = make(map[string]bool)
if err := mutex.MainWorker.Start(); err != nil {
if err = mutex.MainWorker.Start(); err != nil {
log.Warnf("purge: %s (start)", err.Error())
return purgedFiles, purgedPhotos, 0, err
}