tie deliverator in to shutdown sequence
Ted Unangst tedu@tedunangst.com
Mon, 15 Jan 2024 23:09:41 -0500
1 files changed,
6 insertions(+),
0 deletions(-)
jump to
M
deliverator.go
→
deliverator.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()