Pass the correct context to Consumer.Start so that it will actually stop
when singalled
This commit is contained in:
parent
567885af60
commit
7c09c37a51
1 changed files with 3 additions and 1 deletions
|
@ -137,10 +137,12 @@ func runConsumers(ctx context.Context, db *gorm.DB, doneCh chan struct{}) {
|
|||
c, err := NewConsumer(subCtx, &remote, db)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("Failed to create a consumer for %q: %s", remote.Host, err)
|
||||
cancel()
|
||||
continue
|
||||
}
|
||||
if err := c.Start(ctx); err != nil {
|
||||
if err := c.Start(subCtx); err != nil {
|
||||
log.Error().Err(err).Msgf("Failed ot start a consumer for %q: %s", remote.Host, err)
|
||||
cancel()
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue