mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-19 15:23:36 +00:00
Better termination handling in Scanner's progress
This commit is contained in:
1 parent
1ee9ba8d74
commit
a0195aa5d3
3 files changed
+36
-31
No files matched your search
@@ -39,7 +39,8 @@ func (c *LibraryScanningController) GetScanStatus(w http.ResponseWriter, r *http
|
||||
}
|
||||
|
||||
func (c *LibraryScanningController) StartScan(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error) {
|
||||
loggedUser, ok := request.UserFrom(r.Context())
|
||||
ctx := r.Context()
|
||||
loggedUser, ok := request.UserFrom(ctx)
|
||||
if !ok {
|
||||
return nil, newError(responses.ErrorGeneric, "Internal error")
|
||||
}
|
||||
@@ -51,9 +52,9 @@ func (c *LibraryScanningController) StartScan(w http.ResponseWriter, r *http.Req
|
||||
fullScan := utils.ParamBool(r, "fullScan", false)
|
||||
|
||||
go func() {
|
||||
err := c.scanner.RescanAll(fullScan)
|
||||
err := c.scanner.RescanAll(ctx, fullScan)
|
||||
if err != nil {
|
||||
log.Error(r.Context(), err)
|
||||
log.Error(ctx, err)
|
||||
}
|
||||
}()
|
||||
|
||||
|
||||
Reference in new issue
Block a user