Merge pull request #443 from MayurWitsLab/fix/publisher
error function in publisher
This commit is contained in:
@@ -10,5 +10,5 @@ type Publisher interface {
|
|||||||
|
|
||||||
type PublisherProvider interface {
|
type PublisherProvider interface {
|
||||||
// New initializes a new publisher instance with the given configuration.
|
// New initializes a new publisher instance with the given configuration.
|
||||||
New(ctx context.Context, config map[string]string) (Publisher, func(), error)
|
New(ctx context.Context, config map[string]string) (Publisher, func() error, error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,7 +130,13 @@ func (m *Manager) Publisher(ctx context.Context, cfg *Config) (definition.Publis
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
m.addCloser(closer)
|
if closer != nil {
|
||||||
|
m.addCloser(func() {
|
||||||
|
if err := closer(); err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
return p, nil
|
return p, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user