mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 10:24:37 +03:00
queue: when shutting down, wait for pending deliveries before signaling that shutdown is complete
also fixes flaky test, which is how i found it
This commit is contained in:
@ -1154,6 +1154,10 @@ func startQueue(resolver dns.Resolver, done chan struct{}) {
|
||||
for {
|
||||
select {
|
||||
case <-mox.Shutdown.Done():
|
||||
for len(busyDomains) > 0 {
|
||||
domain := <-deliveryResults
|
||||
delete(busyDomains, domain)
|
||||
}
|
||||
done <- struct{}{}
|
||||
return
|
||||
case <-msgqueue:
|
||||
|
Reference in New Issue
Block a user