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

Method Sync

server/sync_writer.go:116–129  ·  view source on GitHub ↗

Sync runs a synchronization iteration, which executes requests in the event table.

()

Source from the content-addressed store, hash-verified

114// Sync runs a synchronization iteration, which
115// executes requests in the event table.
116func (writer *SyncWriter) Sync() (synced int, err error) {
117 resourceList, err := writer.listEvents()
118 if err != nil {
119 return
120 }
121 for _, resource := range resourceList {
122 err = writer.syncEvent(resource)
123 if err != nil {
124 return
125 }
126 synced++
127 }
128 return
129}
130
131func (writer *SyncWriter) listEvents() ([]*schema.Resource, error) {
132 var resourceList []*schema.Resource

Callers 2

RunMethod · 0.95
ResyncFunction · 0.95

Calls 2

listEventsMethod · 0.95
syncEventMethod · 0.95

Tested by

no test coverage detected