Honoring ConnectionTimeout in boltdb
Signed-off-by: Madhu Venugopal <madhu@docker.com>
This commit is contained in:
parent
29a75f0428
commit
64eb25dff9
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue