Skip to content
Snippets Groups Projects
Commit 48c5761b authored by Brian Knox's avatar Brian Knox
Browse files

exit on os.Interrupt

parent 98db5a0a
No related branches found
No related tags found
No related merge requests found
...@@ -4,6 +4,8 @@ import ( ...@@ -4,6 +4,8 @@ import (
"flag" "flag"
"log" "log"
"net/http" "net/http"
"os"
"os/signal"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )
...@@ -21,6 +23,13 @@ func main() { ...@@ -21,6 +23,13 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
go func() {
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
<-c
os.Exit(0)
}()
go func() { go func() {
exporter.run() exporter.run()
}() }()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment