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

Method CheckpointNow

db/active_replicator_checkpointer.go:230–250  ·  view source on GitHub ↗

CheckpointNow forces the checkpointer to send a checkpoint, and blocks until it has finished.

()

Source from the content-addressed store, hash-verified

228
229// CheckpointNow forces the checkpointer to send a checkpoint, and blocks until it has finished.
230func (c *Checkpointer) CheckpointNow() {
231 if c == nil {
232 return
233 }
234
235 c.lock.Lock()
236 defer c.lock.Unlock()
237
238 base.TracefCtx(c.ctx, base.KeyReplicate, "checkpointer: running")
239
240 seq := c._updateCheckpointLists()
241 if seq == nil {
242 return
243 }
244
245 base.InfofCtx(c.ctx, base.KeyReplicate, "checkpointer: calculated seq: %v", seq)
246 err := c._setCheckpoints(seq)
247 if err != nil {
248 base.WarnfCtx(c.ctx, "couldn't set checkpoints: %v", err)
249 }
250}
251
252// Stats returns a copy of the checkpointer stats. Intended for test use - non-test usage may have
253// performance implications associated with locking

Calls 7

_setCheckpointsMethod · 0.95
TracefCtxFunction · 0.92
InfofCtxFunction · 0.92
WarnfCtxFunction · 0.92
LockMethod · 0.45
UnlockMethod · 0.45