1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

Add parameter to support dockernize

This commit is contained in:
Timothy 2016-06-29 18:21:58 +08:00
parent 1efae80b84
commit 2f6c8c23e3

View File

@ -18,8 +18,9 @@ const (
var (
configuration Settings
optConf = flag.String("c", "./config.json", "config file")
optHelp = flag.Bool("h", false, "this help")
optConf = flag.String("c", "./config.json", "Specify a config file")
optDocker = flag.Bool("d", false, "Run it as docker mode")
optHelp = flag.Bool("h", false, "Show help")
panicCount = 0
)
@ -87,6 +88,7 @@ func dnsLoop() {
panicCount++
log.Printf("Recovered in %v: %v\n", err, debug.Stack())
fmt.Println(identifyPanic())
log.Print(identifyPanic())
if panicCount < PANIC_MAX {
log.Println("Got panic in goroutine, will start a new one... :", panicCount)
go dnsLoop()