From 3c7d500ef914c46e03cb662746f57e1584fe0cfd Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 9 May 2020 14:58:19 -0400 Subject: [PATCH] bgmonitor to see if we're losing connection slots --- go.mod | 2 +- go.sum | 6 ++---- web.go | 9 +++++++++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 8faa9bf..f166317 100644 --- a/go.mod +++ b/go.mod @@ -9,5 +9,5 @@ require ( golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 golang.org/x/net v0.0.0-20190620200207-3b0461eec859 humungus.tedunangst.com/r/go-sqlite3 v1.1.3 - humungus.tedunangst.com/r/webs v0.6.40 + humungus.tedunangst.com/r/webs v0.6.41 ) diff --git a/go.sum b/go.sum index e9100f9..f1f75e6 100644 --- a/go.sum +++ b/go.sum @@ -22,7 +22,5 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= humungus.tedunangst.com/r/go-sqlite3 v1.1.3 h1:G2N4wzDS0NbuvrZtQJhh4F+3X+s7BF8b9ga8k38geUI= humungus.tedunangst.com/r/go-sqlite3 v1.1.3/go.mod h1:FtEEmQM7U2Ey1TuEEOyY1BmphTZnmiEjPsNLEAkpf/M= -humungus.tedunangst.com/r/webs v0.6.36 h1:Y0V6sYwruiradsyP2Y4EzQ3T+kZxrtUfuC7Bwu0GRsY= -humungus.tedunangst.com/r/webs v0.6.36/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= -humungus.tedunangst.com/r/webs v0.6.40 h1:gYAsjGPuQwqwekKd6fZl8smoaox+BsDD1U4MA339PAc= -humungus.tedunangst.com/r/webs v0.6.40/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= +humungus.tedunangst.com/r/webs v0.6.41 h1:kteIzz03ij7EujsLLbRlquSgONRzoqIm1o1Bc5ie6HU= +humungus.tedunangst.com/r/webs v0.6.41/go.mod h1:S9sXpVSbgAIa24yYhnMN0C94LKHG+2rioS+NsiDimps= diff --git a/web.go b/web.go index 539972e..5e1cd21 100644 --- a/web.go +++ b/web.go @@ -2334,6 +2334,14 @@ func wait100ms() chan struct{} { return c } +func bgmonitor() { + for { + time.Sleep(5 * time.Minute) + log.Printf("good morning!") + log.Printf("outstanding deliveries: %s", garage.Outstanding()) + } +} + func serve() { db := opendatabase() login.Init(db) @@ -2346,6 +2354,7 @@ func serve() { go enditall() go redeliverator() go tracker() + go bgmonitor() w100 := wait100ms() getconfig("debug", &debugMode)