Skip to content

Commit

Permalink
add wait group to start
Browse files Browse the repository at this point in the history
  • Loading branch information
NV4RE committed Oct 12, 2023
1 parent 1627db8 commit 600f430
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions worker_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ type KafkaWorkerManager struct {
}

// Start all workers
func (k KafkaWorkerManager) Start() []error {
wg := sync.WaitGroup{}
func (k KafkaWorkerManager) Start(wg *sync.WaitGroup) []error {
if wg == nil {
wg = &sync.WaitGroup{}
}
ctx, cancel := context.WithCancel(context.Background())

// Wait for OS SIGINT/SIGTERM then gracefully shutdown the workers
Expand Down

0 comments on commit 600f430

Please sign in to comment.