Skip to content

Commit

Permalink
fix (#142)
Browse files Browse the repository at this point in the history
Co-authored-by: AlteredCoder <AlteredCoder>
  • Loading branch information
AlteredCoder authored Jul 20, 2020
1 parent 66161bc commit 40b7bfa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cwplugin/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func NewBackendPlugin(outputConfig map[string]string) (*BackendManager, error) {
log.Errorf("parsing '%s' yaml error : %s, skipping", file, err)
continue
}

plug, err := plugin.Open(newPlugin.Path)
if err != nil {
return nil, err
Expand All @@ -100,8 +101,8 @@ func NewBackendPlugin(outputConfig map[string]string) (*BackendManager, error) {
// Add the interface and Init()
newPlugin.funcs = bInterface
// Merge backend config from main config file
if v, ok := outputConfig["debug"]; ok {
newPlugin.Config["debug"] = v
if v, ok := outputConfig["debug"]; ok && v == "true" {
newPlugin.Config["debug"] = "true"
}

if v, ok := outputConfig["max_records"]; ok {
Expand All @@ -112,10 +113,9 @@ func NewBackendPlugin(outputConfig map[string]string) (*BackendManager, error) {
newPlugin.Config["max_records_age"] = v
}

if v, ok := outputConfig["flush"]; ok {
if v, ok := outputConfig["flush"]; ok && v == "true" {
newPlugin.Config["flush"] = v
}

err = newPlugin.funcs.Init(newPlugin.Config)
if err != nil {
return nil, fmt.Errorf("plugin '%s' init error : %s", newPlugin.Name, err)
Expand Down

0 comments on commit 40b7bfa

Please sign in to comment.