watch stdin, kill server if stdin is closed
()
| 98 | |
| 99 | // watch stdin, kill server if stdin is closed |
| 100 | func stdinReadWatch() { |
| 101 | defer func() { |
| 102 | panichandler.PanicHandler("stdinReadWatch", recover()) |
| 103 | }() |
| 104 | buf := make([]byte, 1024) |
| 105 | for { |
| 106 | _, err := os.Stdin.Read(buf) |
| 107 | if err != nil { |
| 108 | doShutdown(fmt.Sprintf("stdin closed/error (%v)", err)) |
| 109 | break |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | func startConfigWatcher() { |
| 115 | watcher := wconfig.GetWatcher() |
no test coverage detected