feat: add sonarr support
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
159f1c1a6c
commit
de33bcb362
12
main.go
12
main.go
|
@ -35,11 +35,7 @@ func main() {
|
|||
log.Fatalln("newServer:", err)
|
||||
}
|
||||
|
||||
go func(srv *http.Server) {
|
||||
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||
log.Fatalln("srv.ListenAndServe:", err)
|
||||
}
|
||||
}(srv)
|
||||
go startServer(srv)
|
||||
|
||||
log.Println("Server is listening on the port", defaultPort)
|
||||
|
||||
|
@ -121,6 +117,12 @@ func newSonarrService() (*service.Sonarr, error) {
|
|||
), nil
|
||||
}
|
||||
|
||||
func startServer(srv *http.Server) {
|
||||
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
|
||||
log.Fatalln("srv.ListenAndServe:", err)
|
||||
}
|
||||
}
|
||||
|
||||
func waitForSignal(ctx context.Context) {
|
||||
ctx, stop := signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM)
|
||||
defer stop()
|
||||
|
|
Reference in New Issue