MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / Start

Method Start

db/active_replicator.go:68–93  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

66}
67
68func (ar *ActiveReplicator) Start(ctx context.Context) error {
69
70 if ar.Push == nil && ar.Pull == nil {
71 return fmt.Errorf("Attempted to start activeReplicator for %s with neither Push nor Pull defined", base.UD(ar.ID))
72 }
73
74 var pushErr error
75 if ar.Push != nil {
76 pushErr = ar.Push.Start(ctx)
77 }
78
79 var pullErr error
80 if ar.Pull != nil {
81 pullErr = ar.Pull.Start(ctx)
82 }
83
84 if pushErr != nil {
85 return pushErr
86 }
87
88 if pullErr != nil {
89 return pullErr
90 }
91
92 return nil
93}
94
95func (ar *ActiveReplicator) Stop() error {
96

Calls 3

UDFunction · 0.92
ErrorfMethod · 0.80
StartMethod · 0.65