mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-14 19:20:37 +03:00
Add more info in search log message
This commit is contained in:
parent
c0066ebd85
commit
ebf7354df4
@ -60,14 +60,14 @@ func doSearch[T any](ctx context.Context, wg *sync.WaitGroup, s searchFunc[T], q
|
||||
}
|
||||
done := make(chan struct{})
|
||||
go func() {
|
||||
typ := reflect.TypeOf(res).String()
|
||||
typ := strings.TrimPrefix(reflect.TypeOf(res).String(), "model.")
|
||||
var err error
|
||||
start := time.Now()
|
||||
res, err = s(q, offset, size)
|
||||
if err != nil {
|
||||
log.Error(ctx, "Error searching "+typ, err)
|
||||
log.Error(ctx, "Error searching "+typ, "query", q, err)
|
||||
} else {
|
||||
log.Trace(ctx, "Search for "+typ+" completed", "elapsedTime", time.Since(start))
|
||||
log.Trace(ctx, "Search for "+typ+" completed", "query", q, "elapsedTime", time.Since(start))
|
||||
}
|
||||
done <- struct{}{}
|
||||
}()
|
||||
|
Loading…
x
Reference in New Issue
Block a user