Honoring ConnectionTimeout in boltdb

Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
Madhu Venugopal 2015-09-16 10:52:11 -07:00
parent 29a75f0428
commit 64eb25dff9

View file

@ -55,7 +55,12 @@ func New(endpoints []string, options *store.Config) (store.Store, error) {
if err := os.MkdirAll(dir, 0750); err != nil {
return nil, err
}
db, err := bolt.Open(endpoints[0], 0644, nil)
var boltOptions *bolt.Options
if options != nil {
boltOptions = &bolt.Options{Timeout: options.ConnectionTimeout}
}
db, err := bolt.Open(endpoints[0], 0644, boltOptions)
if err != nil {
return nil, err
}