MCPcopy Create free account
hub / github.com/pydio/cells / SetupEventsChan

Method SetupEventsChan

common/sync/task/sync.go:219–234  ·  view source on GitHub ↗

SetupEventsChan wires internal sync event to external status channels

(statusChan chan model.Status, batchDone chan interface{}, events chan interface{})

Source from the content-addressed store, hash-verified

217
218// SetupEventsChan wires internal sync event to external status channels
219func (s *Sync) SetupEventsChan(statusChan chan model.Status, batchDone chan interface{}, events chan interface{}) {
220 s.statuses = statusChan
221 s.runDone = batchDone
222 if events != nil {
223 // Forward internal events to sync event
224 s.watchConn = make(chan *model.EndpointStatus)
225 go func() {
226 defer func() {
227 recover()
228 }()
229 for e := range s.watchConn {
230 events <- e
231 }
232 }()
233 }
234}
235
236func (s *Sync) SetupCmd(cmd *model.Command) {
237 s.cmd = cmd

Callers 3

FlatSyncSnapshotMethod · 0.95
TriggerResyncMethod · 0.80
watchDisconnectionMethod · 0.80

Calls 1

makeFunction · 0.85

Tested by

no test coverage detected