closing channels as soon as the producer has stopped

This commit is contained in:
pippellia-btc
2025-09-19 17:52:36 +02:00
parent 076a3a40da
commit 68d896cff3
2 changed files with 4 additions and 3 deletions

View File

@@ -85,6 +85,7 @@ func main() {
defer producers.Done()
gate := pipe.NewExistenceGate(db)
pipe.Firehose(ctx, config.Firehose, gate, pipe.Send(recorderQueue))
close(recorderQueue)
}()
go func() {
@@ -100,7 +101,7 @@ func main() {
go func() {
defer producers.Done()
pipe.Arbiter(ctx, config.Arbiter, db, pipe.Send(fetcherQueue))
close(fetcherQueue) // Arbiter is the only pubkey producer
close(fetcherQueue)
}()
consumers.Add(1)

View File

@@ -81,13 +81,13 @@ func main() {
go func() {
defer wg.Done()
pipe.FetcherDB(ctx, config.Fetcher, fetcherQueue, store, pipe.Send(grapherQueue))
close(grapherQueue) // FetcherDB is the only event producer
close(grapherQueue)
}()
go func() {
defer wg.Done()
pipe.Arbiter(ctx, config.Arbiter, db, pipe.Send(fetcherQueue))
close(fetcherQueue) // Arbiter is the only pubkey producer
close(fetcherQueue)
}()
go func() {