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

Method _connect

db/active_replicator_push.go:45–69  ·  view source on GitHub ↗

_connect opens up a connection, and starts replicating.

()

Source from the content-addressed store, hash-verified

43
44// _connect opens up a connection, and starts replicating.
45func (apr *ActivePushReplicator) _connect() error {
46 var err error
47 apr.blipSender, apr.blipSyncContext, err = connect(apr.activeReplicatorCommon, "-push")
48 if err != nil {
49 return err
50 }
51
52 // TODO: If this were made a config option, and the default conflict resolver not enforced on
53 // the pull side, it would be feasible to run sgr-2 in 'manual conflict resolution' mode
54 apr.blipSyncContext.sendRevNoConflicts = true
55
56 if apr.config.CollectionsEnabled {
57 if err := apr._startPushWithCollections(); err != nil {
58 return err
59 }
60 } else {
61 // for backwards compatibility use no collection-specific handling/messages
62 if err := apr._startPushNonCollection(); err != nil {
63 return err
64 }
65 }
66
67 apr.setState(ReplicationStateRunning)
68 return nil
69}
70
71// Complete gracefully shuts down a replication, waiting for all in-flight revisions to be processed
72// before stopping the replication

Callers

nothing calls this directly

Calls 4

connectFunction · 0.85
setStateMethod · 0.80

Tested by

no test coverage detected