Purge: Sleep 250ms to give database time for other tasks

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-05-10 22:21:05 +02:00
parent 556a0dd38b
commit b865203d89

View file

@ -5,6 +5,7 @@ import (
"fmt"
"path"
"runtime"
"time"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/event"
@ -110,6 +111,8 @@ func (prg *Purge) Start(opt PurgeOptions) (purgedFiles map[string]bool, purgedPh
}
offset += limit
time.Sleep(250 * time.Millisecond)
}
limit = 500
@ -159,6 +162,8 @@ func (prg *Purge) Start(opt PurgeOptions) (purgedFiles map[string]bool, purgedPh
}
offset += limit
time.Sleep(250 * time.Millisecond)
}
if err := query.ResetPhotosQuality(); err != nil {