Skip to content

Commit 1e73afa

Browse files
Michal Tichákknopers8
authored andcommitted
Added missing kafka messages to DCS for SOR and EOR
1 parent 70a6a17 commit 1e73afa

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

core/integration/dcs/plugin.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
16321632
detPayload := map[string]interface{}{}
16331633
_ = copier.Copy(&detPayload, payload)
16341634
detPayload["detector"] = ecsDet
1635+
detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())]
16351636
detPayload["dcsEvent"] = dcsEvent
16361637
detPayloadJson, _ := json.Marshal(detPayload)
16371638

@@ -1659,6 +1660,25 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
16591660
WithField("level", infologger.IL_Devel).
16601661
WithField("run", runNumber64).
16611662
Info("ALIECS SOR operation : processing DCS SOR for ")
1663+
1664+
ecsDet := dcsToEcsDetector(dcsEvent.GetDetector())
1665+
detPayload := map[string]interface{}{}
1666+
_ = copier.Copy(&detPayload, payload)
1667+
detPayload["detector"] = ecsDet
1668+
detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())]
1669+
detPayload["dcsEvent"] = dcsEvent
1670+
detPayloadJson, _ := json.Marshal(detPayload)
1671+
1672+
the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{
1673+
Name: call.GetName(),
1674+
OperationName: call.Func,
1675+
OperationStatus: pb.OpStatus_ONGOING,
1676+
OperationStep: "perform DCS call: StartOfRun",
1677+
OperationStepStatus: pb.OpStatus_ONGOING,
1678+
EnvironmentId: envId,
1679+
Payload: string(detPayloadJson[:]),
1680+
})
1681+
16621682
}
16631683

16641684
}
@@ -2132,6 +2152,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
21322152
detPayload := map[string]interface{}{}
21332153
_ = copier.Copy(&detPayload, payload)
21342154
detPayload["detector"] = ecsDet
2155+
detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())]
21352156
detPayload["dcsEvent"] = dcsEvent
21362157
detPayloadJson, _ := json.Marshal(detPayload)
21372158

@@ -2159,6 +2180,25 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
21592180
WithField("level", infologger.IL_Devel).
21602181
WithField("run", runNumber64).
21612182
Info("ALIECS EOR operation : processing DCS EOR for ")
2183+
2184+
ecsDet := dcsToEcsDetector(dcsEvent.GetDetector())
2185+
detPayload := map[string]interface{}{}
2186+
_ = copier.Copy(&detPayload, payload)
2187+
detPayload["detector"] = ecsDet
2188+
detPayload["state"] = dcspb.DetectorState_name[int32(dcsEvent.GetState())]
2189+
detPayload["dcsEvent"] = dcsEvent
2190+
detPayloadJson, _ := json.Marshal(detPayload)
2191+
2192+
the.EventWriterWithTopic(TOPIC).WriteEvent(&pb.Ev_IntegratedServiceEvent{
2193+
Name: call.GetName(),
2194+
OperationName: call.Func,
2195+
OperationStatus: pb.OpStatus_ONGOING,
2196+
OperationStep: "perform DCS call: EndOfRun",
2197+
OperationStepStatus: pb.OpStatus_ONGOING,
2198+
EnvironmentId: envId,
2199+
Payload: string(detPayloadJson[:]),
2200+
})
2201+
21622202
}
21632203
}
21642204

0 commit comments

Comments
 (0)