Pass the correct context to Consumer.Start so that it will actually stop
when singalledmain
parent
567885af60
commit
7c09c37a51
|
@ -137,10 +137,12 @@ func runConsumers(ctx context.Context, db *gorm.DB, doneCh chan struct{}) {
|
||||||
c, err := NewConsumer(subCtx, &remote, db)
|
c, err := NewConsumer(subCtx, &remote, db)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msgf("Failed to create a consumer for %q: %s", remote.Host, err)
|
log.Error().Err(err).Msgf("Failed to create a consumer for %q: %s", remote.Host, err)
|
||||||
|
cancel()
|
||||||
continue
|
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)
|
log.Error().Err(err).Msgf("Failed ot start a consumer for %q: %s", remote.Host, err)
|
||||||
|
cancel()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue