From a297247137b2170e78cb798bc62dada11ba63b06 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 28 Jan 2024 14:27:32 -0800 Subject: [PATCH] wait for each publish clients --- weed/mq/client/pub_client/publisher.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weed/mq/client/pub_client/publisher.go b/weed/mq/client/pub_client/publisher.go index 2bf866395..c952bcfb6 100644 --- a/weed/mq/client/pub_client/publisher.go +++ b/weed/mq/client/pub_client/publisher.go @@ -10,7 +10,6 @@ import ( "google.golang.org/grpc/credentials/insecure" "log" "sync" - "time" ) type PublisherConfiguration struct { @@ -63,7 +62,10 @@ func (p *TopicPublisher) Shutdown() error { inputBuffer.CloseInput() } } - time.Sleep(1100 * time.Millisecond) + + for _, job := range p.jobs { + job.wg.Wait() + } return nil }