Fix signaler not exiting on cancel (#1638)

* fix: make signaler exit on cancel

`break` is incorrect here, as it just breaks out of the select.
`return` to exit the function instead.

Fixes #1636.

Signed-off-by: Ian Kerins <ianskerins@gmail.com>

* fix: exit non-zero on fatal error

Signed-off-by: Ian Kerins <ianskerins@gmail.com>
This commit is contained in:
Ian Kerins 2022-03-30 10:04:17 -04:00 committed by GitHub
parent 5987cd0c08
commit ce0db8344b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -69,6 +69,7 @@ func runNavidrome() {
if err := g.Run(); err != nil {
log.Error("Fatal error in Navidrome. Aborting", err)
os.Exit(1)
}
}
@ -111,7 +112,7 @@ func startSignaler() (func() error, func(err error)) {
}
log.Info(ctx, "Triggered scan complete", "elapsed", time.Since(start).Round(100*time.Millisecond))
case <-ctx.Done():
break
return nil
}
}
}, func(err error) {