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:
Mechiel Lukkien
2024-04-28 22:48:51 +02:00
parent ff6cca1bf9
commit b7ec84b80a
4 changed files with 10 additions and 5 deletions

View File

@ -78,7 +78,7 @@ func start(mtastsdbRefresher, sendDMARCReports, sendTLSReports, skipForkExec boo
return fmt.Errorf("tlsrpt init: %s", err)
}
done := make(chan struct{}, 4) // Goroutines for messages and webhooks, and cleaners.
done := make(chan struct{}) // Goroutines for messages and webhooks, and cleaners.
if err := queue.Start(dns.StrictResolver{Pkg: "queue"}, done); err != nil {
return fmt.Errorf("queue start: %s", err)
}