Skip to content

Commit

Permalink
Added kafka message to DCS for any detector change for any detector
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák authored and knopers8 committed Sep 25, 2024
1 parent 69b64e5 commit ed1bbff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions core/integration/dcs/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,24 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
WithField("partition", envId).
WithField("level", infologger.IL_Devel).
Info("ALIECS PFR operation : processing DCS PFR for ")

ecsDet := dcsToEcsDetector(dcsEvent.GetDetector())
detPayload := map[string]interface{}{}
_ = copier.Copy(&detPayload, payload)
detPayload["detector"] = ecsDet
detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())]
detPayload["dcsEvent"] = dcsEvent
detPayloadJson, _ := json.Marshal(detPayload)

the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{
Name: call.GetName(),
OperationName: call.Func,
OperationStatus: pb.OpStatus_ONGOING,
OperationStep: "perform DCS call: PrepareForRun",
OperationStepStatus: pb.OpStatus_ONGOING,
EnvironmentId: envId,
Payload: string(detPayloadJson[:]),
})
}

}
Expand Down

0 comments on commit ed1bbff

Please sign in to comment.