MCPcopy
hub / github.com/benbjohnson/litestream / Sync

Method Sync

db.go:1165–1172  ·  view source on GitHub ↗

Sync copies pending data from the WAL to the shadow WAL.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1163
1164// Sync copies pending data from the WAL to the shadow WAL.
1165func (db *DB) Sync(ctx context.Context) (err error) {
1166 db.execMu.Lock()
1167 defer db.execMu.Unlock()
1168 db.beginSyncDiag(diagOpSync)
1169 defer func() { db.finishSyncDiag(err) }()
1170
1171 return db.syncLocked(ctx)
1172}
1173
1174func (db *DB) syncLocked(ctx context.Context) (err error) {
1175 // Track total sync metrics.

Calls 5

beginSyncDiagMethod · 0.95
finishSyncDiagMethod · 0.95
syncLockedMethod · 0.95
LockMethod · 0.45
UnlockMethod · 0.45