diff --git a/internal/impl/confluent/processor_schema_registry_encode.go b/internal/impl/confluent/processor_schema_registry_encode.go index dbc17d0739..0ae765e8ab 100644 --- a/internal/impl/confluent/processor_schema_registry_encode.go +++ b/internal/impl/confluent/processor_schema_registry_encode.go @@ -303,12 +303,13 @@ func newSchemaRegistryEncoder( return nil, err } + shutSig := s.shutSig go func() { for { select { case <-time.After(schemaRefreshTicker): s.refreshEncoders() - case <-s.shutSig.SoftStopChan(): + case <-shutSig.SoftStopChan(): return } }