all repos — honk @ 353f6348f9ad903f311426607789623c4271bece

my fork of honk

tie deliverator in to shutdown sequence
Ted Unangst tedu@tedunangst.com
Mon, 15 Jan 2024 23:09:41 -0500
commit

353f6348f9ad903f311426607789623c4271bece

parent

b9c7fb253fe7d89846ba287ec0cafff32139b92a

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

jump to
M deliverator.godeliverator.go

@@ -121,6 +121,8 @@

var garage = gate.NewLimiter(40) func deliveration(doover Doover) { + requestWG.Add(1) + defer requestWG.Done() rcpt := doover.Rcpt garage.StartKey(rcpt) defer garage.FinishKey(rcpt)

@@ -207,6 +209,7 @@ return nil

} func redeliverator() { + workinprogress++ sleeper := time.NewTimer(5 * time.Second) for { select {

@@ -216,6 +219,9 @@ <-sleeper.C

} time.Sleep(5 * time.Second) case <-sleeper.C: + case <-endoftheworld: + readyalready <- true + return } doovers := getdoovers()