mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-18 18:38:08 -05:00
only update SCADA metadata if status changes (#18585)
* only update SCADA metadata if status changes * add changelog entry
This commit is contained in:
parent
76741f914a
commit
6d92f10bdc
2 changed files with 10 additions and 1 deletions
3
changelog/18585.txt
Normal file
3
changelog/18585.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
hcp/connectivity: Only update SCADA session metadata if status changes
|
||||
```
|
||||
|
|
@ -222,6 +222,8 @@ func (h *HCPLinkVault) start() error {
|
|||
// API. In addition, it checks replication status of Vault and sets that in
|
||||
// Scada provider metadata status
|
||||
func (h *HCPLinkVault) reportStatus() {
|
||||
var currentNodeStatus string
|
||||
|
||||
ticker := time.NewTicker(SetLinkStatusCadence)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
|
|
@ -249,7 +251,11 @@ func (h *HCPLinkVault) reportStatus() {
|
|||
nodeStatus = activeStatus
|
||||
}
|
||||
|
||||
h.linkConfig.SCADAProvider.UpdateMeta(map[string]string{metaDataNodeStatus: nodeStatus})
|
||||
// Only update SCADA session metadata if status has changed
|
||||
if currentNodeStatus != nodeStatus {
|
||||
currentNodeStatus = nodeStatus
|
||||
h.linkConfig.SCADAProvider.UpdateMeta(map[string]string{metaDataNodeStatus: currentNodeStatus})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue