check to see if backend server dies

This commit is contained in:
Ted Unangst 2020-04-27 21:14:05 -04:00
parent 52e35b2ca4
commit f8eefd5c72
2 changed files with 4 additions and 2 deletions

View File

@ -100,7 +100,7 @@ func backendServer() {
srv.Accept(lis) srv.Accept(lis)
} }
func startBackendServer() { func runBackendServer() {
proc := exec.Command(os.Args[0], "-datadir", dataDir, "backend") proc := exec.Command(os.Args[0], "-datadir", dataDir, "backend")
proc.Stdout = os.Stdout proc.Stdout = os.Stdout
proc.Stderr = os.Stderr proc.Stderr = os.Stderr
@ -108,4 +108,6 @@ func startBackendServer() {
if err != nil { if err != nil {
log.Panicf("can't exec backend: %s", err) log.Panicf("can't exec backend: %s", err)
} }
err = proc.Wait()
log.Panicf("lost the backend: %s", err)
} }

2
web.go
View File

@ -2325,7 +2325,7 @@ func serve() {
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
startBackendServer() go runBackendServer()
go enditall() go enditall()
go redeliverator() go redeliverator()
go tracker() go tracker()