all repos — honk @ 96d719198885a712029fdc39a80e37f0b9586355

my fork of honk

hack to give backend 100ms to really get going
Ted Unangst tedu@tedunangst.com
Fri, 08 May 2020 16:50:08 -0400
commit

96d719198885a712029fdc39a80e37f0b9586355

parent

52723eb6a79b67fc322394b04db7917d0916d739

1 files changed, 11 insertions(+), 0 deletions(-)

jump to
M web.goweb.go

@@ -2325,6 +2325,15 @@ }

var preservehooks []func() +func wait100ms() chan struct{} { + c := make(chan struct{}) + go func() { + time.Sleep(100 * time.Millisecond) + close(c) + }() + return c +} + func serve() { db := opendatabase() login.Init(db)

@@ -2337,6 +2346,7 @@ go runBackendServer()

go enditall() go redeliverator() go tracker() + w100 := wait100ms() getconfig("debug", &debugMode) readviews = templates.Load(debugMode,

@@ -2364,6 +2374,7 @@ savedassetparams[s] = getassetparam(s)

} loadAvatarColors() } + <-w100 for _, h := range preservehooks { h()