docs(8.0): consistency-model concept + snapshots guide — Db API replaces branching docs
This commit is contained in:
parent
e5feae4104
commit
cc8037db10
23 changed files with 1053 additions and 1871 deletions
|
|
@ -275,10 +275,15 @@ class BackupAugmentation extends BaseAugmentation {
|
|||
|
||||
private async performBackup(brain?: any): Promise<void> {
|
||||
if (!brain) return
|
||||
// Create instant COW snapshot
|
||||
const snapshotName = `backup-${Date.now()}`
|
||||
await brain.fork(snapshotName)
|
||||
console.log(`Automatic snapshot created: ${snapshotName}`)
|
||||
// Cut an instant hard-link snapshot via the Db API
|
||||
const snapshotPath = `/backups/auto-${Date.now()}`
|
||||
const pin = brain.now()
|
||||
try {
|
||||
await pin.persist(snapshotPath)
|
||||
} finally {
|
||||
await pin.release()
|
||||
}
|
||||
console.log(`Automatic snapshot created: ${snapshotPath}`)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue