MCPcopy Create free account
hub / github.com/cloudwan/gohan / processEvent

Method processEvent

server/state_watcher.go:130–142  ·  view source on GitHub ↗
(event *gohan_sync.Event)

Source from the content-addressed store, hash-verified

128}
129
130func (watcher *StateWatcher) processEvent(event *gohan_sync.Event) {
131 var err error
132 if strings.HasPrefix(event.Key, statePrefix) {
133 err = watcher.StateUpdate(event)
134 log.Info("Completed StateUpdate")
135 } else if strings.HasPrefix(event.Key, monitoringPrefix) {
136 err = watcher.MonitoringUpdate(event)
137 log.Info("Completed MonitoringUpdate")
138 }
139 if err != nil {
140 log.Warning(fmt.Sprintf("error during state update: %s", err))
141 }
142}
143
144//StateUpdate updates the state in the db based on the sync event
145// todo: make private once tests are fixed

Callers 1

iterateMethod · 0.95

Calls 4

StateUpdateMethod · 0.95
MonitoringUpdateMethod · 0.95
InfoMethod · 0.65
WarningMethod · 0.65

Tested by

no test coverage detected