Better termination handling in Scanner's progress

This commit is contained in:
Deluan authored and Joe Stump committed 2026-01-02 19:20:08 +00:00
1 parent 1ee9ba8d74
commit a0195aa5d3
3 files changed
+36 -31

No files matched your search

+4 -3
View File
@@ -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)
}
}()