Added a default value for timeout while opening a boltDB. (#383)

* Added a default value for timeout while opening a boltDB.

* Updated the README.md
This commit is contained in:
Ishan Tyagi
2022-08-03 12:19:27 +05:30
committed by GitHub
parent 6d96fb56af
commit e8a6d1b229
2 changed files with 4 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ type Config struct {
// Timeout is the amount of time to wait to obtain a file lock.
// Only available on Darwin and Linux.
//
// Optional. Default is 0 (no timeout)
// Optional. Default is 60 * time.Second.
Timeout time.Duration
// Open database in read-only mode.
@@ -85,7 +85,7 @@ type Config struct {
var ConfigDefault = Config{
Database: "fiber.db",
Bucket: "fiber_storage",
Timeout: 0,
Timeout: 60 * time.Second,
ReadOnly: false,
Reset: false,
}

View File

@@ -17,7 +17,7 @@ type Config struct {
// Timeout is the amount of time to wait to obtain a file lock.
// Only available on Darwin and Linux.
//
// Optional. Default is 0 (no timeout)
// Optional. Default is set to 60 * time.Second.
Timeout time.Duration
// Open database in read-only mode.
@@ -35,7 +35,7 @@ type Config struct {
var ConfigDefault = Config{
Database: "fiber.db",
Bucket: "fiber_storage",
Timeout: 0,
Timeout: 60 * time.Second,
ReadOnly: false,
Reset: false,
}