Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fix pipe batch hanging and corrupting campaign runtime state if `NextSubscribers()` throws an error.

Kailash Nadhece5a63f3299
diff --git a/internal/manager/manager.go b/internal/manager/manager.go
index c767b0b3..552f6be9 100644
--- a/internal/manager/manager.go
+++ b/internal/manager/manager.go
@@ -280,6 +280,11 @@ func (m *Manager) Run() {
has, err := p.NextSubscribers()
if err != nil {
m.log.Printf("error processing campaign batch (%s): %v", p.camp.Name, err)
+
+ // If the batch fails, stop the pipe and release it so that it doesn't hang forever.
+ // The cleanup() records the state in DB and scanCampaigns() picks it up at a later point.
+ p.Stop(false)
+ p.wg.Done()
continue
}