cache: Implement --cache-db-wait-time flag
This can be used to make the cache wait for other running cache backends to finish rather than erroring after 1 second.
This commit is contained in:
parent
6025bb6ad1
commit
a7dbf32c53
3 changed files with 14 additions and 1 deletions
2
backend/cache/storage_persistent.go
vendored
2
backend/cache/storage_persistent.go
vendored
|
@ -122,7 +122,7 @@ func (b *Persistent) connect() error {
|
|||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to create a data directory %q", b.dataPath)
|
||||
}
|
||||
b.db, err = bolt.Open(b.dbPath, 0644, &bolt.Options{Timeout: 1 * time.Second})
|
||||
b.db, err = bolt.Open(b.dbPath, 0644, &bolt.Options{Timeout: *cacheDbWaitTime})
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to open a cache connection to %q", b.dbPath)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue