Skip to content

Commit dbee456

Browse files
committed
fix: updating readyToSend when config changed
1 parent fd17a92 commit dbee456

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plugins/config_reader.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func (r *ConfigReader) updateAgentConfig(payloadAgentConfig *proto.AgentConfig)
108108
sort.Strings(onDiskAgentConfig.Features)
109109
sort.Strings(payloadAgentConfig.Details.Features)
110110
log.Debugf("OnDisk Agent Features %v", onDiskAgentConfig.Features)
111-
log.Debugf("Payload Agent Features %v", onDiskAgentConfig.Features)
111+
log.Debugf("Payload Agent Features %v", payloadAgentConfig.Details.Features)
112112
r.detailsMu.Unlock()
113113

114114
r.detailsMu.RLock()
@@ -139,8 +139,7 @@ func (r *ConfigReader) updateAgentConfig(payloadAgentConfig *proto.AgentConfig)
139139
log.Errorf("Failed updating Agent config - %v", err)
140140
}
141141
if configUpdated {
142-
r.config.Features = features
143-
log.Debugf("Updated agent config on disk")
142+
log.Debugf("Updated agent config on disk %v %v", features, synchronizeFeatures)
144143
}
145144
}
146145

@@ -155,11 +154,13 @@ func (r *ConfigReader) updateAgentConfig(payloadAgentConfig *proto.AgentConfig)
155154
}
156155

157156
if synchronizeFeatures {
157+
log.Debugf("agent config changed, synchronizeFeatures")
158158
r.synchronizeFeatures(payloadAgentConfig)
159159
}
160160

161161
log.Debugf("agent config changed, updating all plugins %v", payloadAgentConfig)
162162
r.messagePipeline.Process(core.NewMessage(core.AgentConfigChanged, payloadAgentConfig))
163+
r.config.Features = payloadAgentConfig.Details.Features
163164
}
164165
}
165166

0 commit comments

Comments
 (0)