MCPcopy Create free account
hub / github.com/TalkingData/owl / doRestoreAction

Function doRestoreAction

controller/notify.go:111–125  ·  view source on GitHub ↗

发送恢复通知

(strategy_event *types.StrategyEvent, trigger_events map[string]*types.TriggerEvent)

Source from the content-addressed store, hash-verified

109
110//发送恢复通知
111func doRestoreAction(strategy_event *types.StrategyEvent, trigger_events map[string]*types.TriggerEvent) {
112 strategy_event.Status = types.EVENT_CLOSED
113 actions := mydb.GetActions(strategy_event.StrategyID, 1)
114 for _, action := range actions {
115 switch action.Kind {
116 case types.ACTION_NOTIFY:
117 subject := action.RestoreSubject
118 content := fillTemplate(action.RestoreTemplate, generateTemplateObj(strategy_event, triggerEventFilter(trigger_events, types.ACTION_RESTORE)))
119 go broadcast(strategy_event, subject, content, action)
120 case types.ACTION_RUN:
121 go doRun(strategy_event, action)
122
123 }
124 }
125}
126
127func triggerEventFilter(trigger_events map[string]*types.TriggerEvent, action_type int) map[string]*types.TriggerEvent {
128 new_trigger_events := make(map[string]*types.TriggerEvent)

Callers 1

processSingleEventFunction · 0.85

Calls 6

fillTemplateFunction · 0.85
generateTemplateObjFunction · 0.85
triggerEventFilterFunction · 0.85
broadcastFunction · 0.85
doRunFunction · 0.85
GetActionsMethod · 0.80

Tested by

no test coverage detected