rework backend exec to require less waiting
This commit is contained in:
parent
f8c5667a0e
commit
5b26f405aa
|
@ -124,7 +124,9 @@ func runBackendServer() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
elog.Panicf("can't exec backend: %s", err)
|
elog.Panicf("can't exec backend: %s", err)
|
||||||
}
|
}
|
||||||
|
go func() {
|
||||||
proc.Wait()
|
proc.Wait()
|
||||||
elog.Printf("lost the backend: %s", err)
|
elog.Printf("lost the backend: %s", err)
|
||||||
w.Close()
|
w.Close()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
13
web.go
13
web.go
|
@ -2420,15 +2420,6 @@ func enditall() {
|
||||||
|
|
||||||
var preservehooks []func()
|
var preservehooks []func()
|
||||||
|
|
||||||
func wait100ms() chan struct{} {
|
|
||||||
c := make(chan struct{})
|
|
||||||
go func() {
|
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
close(c)
|
|
||||||
}()
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func bgmonitor() {
|
func bgmonitor() {
|
||||||
for {
|
for {
|
||||||
time.Sleep(50 * time.Minute)
|
time.Sleep(50 * time.Minute)
|
||||||
|
@ -2443,13 +2434,12 @@ func serve() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
elog.Fatal(err)
|
elog.Fatal(err)
|
||||||
}
|
}
|
||||||
go runBackendServer()
|
runBackendServer()
|
||||||
go enditall()
|
go enditall()
|
||||||
go redeliverator()
|
go redeliverator()
|
||||||
go tracker()
|
go tracker()
|
||||||
go bgmonitor()
|
go bgmonitor()
|
||||||
loadLingo()
|
loadLingo()
|
||||||
w100 := wait100ms()
|
|
||||||
|
|
||||||
readviews = templates.Load(develMode,
|
readviews = templates.Load(develMode,
|
||||||
viewDir+"/views/honkpage.html",
|
viewDir+"/views/honkpage.html",
|
||||||
|
@ -2482,7 +2472,6 @@ func serve() {
|
||||||
}
|
}
|
||||||
loadAvatarColors()
|
loadAvatarColors()
|
||||||
}
|
}
|
||||||
<-w100
|
|
||||||
|
|
||||||
for _, h := range preservehooks {
|
for _, h := range preservehooks {
|
||||||
h()
|
h()
|
||||||
|
|
Loading…
Reference in New Issue