aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/README.md b/README.md
index 8cc9f3c..2c39a19 100644
--- a/README.md
+++ b/README.md
@@ -370,7 +370,7 @@ func (*Bucket) DeleteBucket(key []byte) error
### Database backups
-Bolt is a single file so it's easy to backup. You can use the `Tx.Copy()`
+Bolt is a single file so it's easy to backup. You can use the `Tx.WriteTo()`
function to write a consistent view of the database to a writer. If you call
this from a read-only transaction, it will perform a hot backup and not block
your other database reads and writes. It will also use `O_DIRECT` when available
@@ -385,7 +385,8 @@ func BackupHandleFunc(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Content-Type", "application/octet-stream")
w.Header().Set("Content-Disposition", `attachment; filename="my.db"`)
w.Header().Set("Content-Length", strconv.Itoa(int(tx.Size())))
- return tx.Copy(w)
+ _, err := tx.WriteTo(w)
+ return err
})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)