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