Base SQL metrics in MetricsWorker (#2002)

* feat: Add metrics worker

* refactor: Add todos for useful for metrics methods

* feat: Run MetricsWorker is Prometheus is Enabled

* refactor: Unused low-level variable was removed in metrics

* feat: No worker for metrics, add more

* refactor: Unnecessary todo removed

* refactor: Remove dead unused constant

* Reduce metrics public interface

Co-authored-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Aleksey Lobanov 2023-01-25 03:26:07 +03:00 committed by GitHub
parent d31faf5249
commit 457e1fc97b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 129 additions and 0 deletions

View file

@ -151,8 +151,10 @@ func (s *scanner) RescanAll(ctx context.Context, fullRescan bool) error {
}
if hasError {
log.Error("Errors while scanning media. Please check the logs")
core.WriteAfterScanMetrics(ctx, s.ds, false)
return ErrScanError
}
core.WriteAfterScanMetrics(ctx, s.ds, true)
return nil
}