mirror of
https://github.com/navidrome/navidrome.git
synced 2026-04-28 03:19:38 +00:00
fix(ui): elapsed time for scans
Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
parent
514aceb785
commit
3350e6c115
5 changed files with 73 additions and 2 deletions
|
|
@ -98,6 +98,7 @@ type ProgressInfo struct {
|
|||
ChangesDetected bool
|
||||
Warning string
|
||||
Error string
|
||||
ForceUpdate bool
|
||||
}
|
||||
|
||||
type scanner interface {
|
||||
|
|
@ -292,7 +293,7 @@ func (s *controller) trackProgress(ctx context.Context, progress <-chan *Progres
|
|||
ScanType: scanType,
|
||||
ElapsedTime: elapsed,
|
||||
}
|
||||
if s.limiter != nil {
|
||||
if s.limiter != nil && !p.ForceUpdate {
|
||||
s.limiter.Do(func() { s.sendMessage(ctx, status) })
|
||||
} else {
|
||||
s.sendMessage(ctx, status)
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ func (s *scannerImpl) scanAll(ctx context.Context, fullScan bool, progress chan<
|
|||
|
||||
func (s *scannerImpl) runGC(ctx context.Context, state *scanState) func() error {
|
||||
return func() error {
|
||||
state.sendProgress(&ProgressInfo{ForceUpdate: true})
|
||||
return s.ds.WithTx(func(tx model.DataStore) error {
|
||||
if state.changesDetected.Load() {
|
||||
start := time.Now()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue