mirror of https://git.jolheiser.com/ugit.git
trap sigterm instead of kill
parent
a9208d2fe2
commit
d4b287ed08
|
@ -11,6 +11,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
"github.com/go-chi/httplog/v2"
|
"github.com/go-chi/httplog/v2"
|
||||||
|
@ -111,7 +112,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
ch := make(chan os.Signal, 1)
|
ch := make(chan os.Signal, 1)
|
||||||
signal.Notify(ch, os.Kill, os.Interrupt)
|
signal.Notify(ch, syscall.SIGTERM, os.Interrupt)
|
||||||
<-ch
|
<-ch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue