Skip to content

Commit

Permalink
Merge pull request #140 from aboch/to
Browse files Browse the repository at this point in the history
Allow client to set boltdb timeout
  • Loading branch information
Santhosh Manohar authored Nov 9, 2016
2 parents 3fce6a0 + 1720c98 commit 1d84310
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- 1.5.3
- 1.7.1

# let us have speedy Docker-based Travis workers
sudo: false
Expand Down
7 changes: 6 additions & 1 deletion store/boltdb/boltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func New(endpoints []string, options *store.Config) (store.Store, error) {
db *bolt.DB
err error
boltOptions *bolt.Options
timeout = transientTimeout
)

if len(endpoints) > 1 {
Expand All @@ -82,11 +83,15 @@ func New(endpoints []string, options *store.Config) (store.Store, error) {
}
}

if options.ConnectionTimeout != 0 {
timeout = options.ConnectionTimeout
}

b := &BoltDB{
client: db,
path: endpoints[0],
boltBucket: []byte(options.Bucket),
timeout: transientTimeout,
timeout: timeout,
PersistConnection: options.PersistConnection,
}

Expand Down

0 comments on commit 1d84310

Please sign in to comment.