aboutsummaryrefslogtreecommitdiff
path: root/tx_test.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-06-21 14:44:22 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-06-21 14:44:28 -0600
commit00ee0da5289dd5aaf9263ee39c8082ff3a9557c7 (patch)
treeeb405a03d008ee600d3d59ac2fe657caf397eabe /tx_test.go
parentMerge pull request #206 from Shopify/pending_page_stats (diff)
downloaddedo-00ee0da5289dd5aaf9263ee39c8082ff3a9557c7.tar.gz
dedo-00ee0da5289dd5aaf9263ee39c8082ff3a9557c7.tar.xz
Add Open() options, flock timeout.
This commit changes Open() to provide an additional Options argument. The options argument currently only has a Timeout which will cause the Open() to return ErrTimeout if a file lock cannot be obtained in time. Fixes #207.
Diffstat (limited to 'tx_test.go')
-rw-r--r--tx_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/tx_test.go b/tx_test.go
index 2fe4723..0528c0d 100644
--- a/tx_test.go
+++ b/tx_test.go
@@ -301,7 +301,7 @@ func TestTx_CopyFile(t *testing.T) {
assert.NoError(t, db.View(func(tx *Tx) error { return tx.CopyFile(dest, 0600) }))
- db2, err := Open(dest, 0600)
+ db2, err := Open(dest, 0600, nil)
assert.NoError(t, err)
defer db2.Close()
@@ -366,7 +366,7 @@ func TestTx_CopyFile_Error_Normal(t *testing.T) {
func ExampleTx_Rollback() {
// Open the database.
- db, _ := Open(tempfile(), 0666)
+ db, _ := Open(tempfile(), 0666, nil)
defer os.Remove(db.Path())
defer db.Close()
@@ -400,7 +400,7 @@ func ExampleTx_Rollback() {
func ExampleTx_CopyFile() {
// Open the database.
- db, _ := Open(tempfile(), 0666)
+ db, _ := Open(tempfile(), 0666, nil)
defer os.Remove(db.Path())
defer db.Close()
@@ -417,7 +417,7 @@ func ExampleTx_CopyFile() {
defer os.Remove(toFile)
// Open the cloned database.
- db2, _ := Open(toFile, 0666)
+ db2, _ := Open(toFile, 0666, nil)
defer db2.Close()
// Ensure that the key exists in the copy.