Skip to content

Commit 7783be0

Browse files
committed
[core] Ensure the DCS client gets op availability on STATE_CHANGE_EVENT
1 parent 93b6c98 commit 7783be0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

core/integration/dcs/plugin.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ func (p *Plugin) updateLastKnownDetectorStates(detectorMatrix []*dcspb.DetectorI
199199
if _, ok := p.detectorMap[dcsDet]; !ok {
200200
p.detectorMap[dcsDet] = detInfo
201201
} else {
202+
// If we're getting a PFR or SOR availability information within the State field of an incoming STATE_CHANGE_EVENT,
203+
// before processing it as any other state change, we need to update the availability fields
204+
if detInfo.State == dcspb.DetectorState_PFR_AVAILABLE || detInfo.State == dcspb.DetectorState_PFR_UNAVAILABLE {
205+
p.detectorMap[dcsDet].PfrAvailability = detInfo.State
206+
}
207+
if detInfo.State == dcspb.DetectorState_SOR_AVAILABLE || detInfo.State == dcspb.DetectorState_SOR_UNAVAILABLE {
208+
p.detectorMap[dcsDet].SorAvailability = detInfo.State
209+
}
210+
211+
// if we're getting a STATE_CHANGE event with any non-null state
202212
if detInfo.State != dcspb.DetectorState_NULL_STATE {
203213
p.detectorMap[dcsDet].State = detInfo.State
204214
timestamp, err := time.Parse(DCS_TIME_FORMAT, detInfo.Timestamp)

0 commit comments

Comments
 (0)