Browse Source

Merge pull request #297 from jsrdxzw/main

add notify channel when exit
pull/300/head
yedf2 4 years ago
committed by GitHub
parent
commit
8b0a64a701
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      main.go

7
main.go

@ -15,7 +15,9 @@ import (
"net/http/httputil"
"net/url"
"os"
"os/signal"
"strings"
"syscall"
"github.com/dtm-labs/dtm/dtmcli/logger"
"github.com/dtm-labs/dtm/dtmsvr/config"
@ -31,7 +33,10 @@ func main() {
app, conf := entry.Main(&Version)
if app != nil {
addAdmin(app, conf)
select {}
q := make(chan os.Signal)
signal.Notify(q, syscall.SIGINT, syscall.SIGTERM)
<-q
logger.Infof("Shutdown dtm server...")
}
}

Loading…
Cancel
Save