forked from TrueCloudLab/frostfs-node
[#1437] blobovnicza: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
6db46257c0
commit
62b5181618
22 changed files with 82 additions and 81 deletions
|
@ -81,12 +81,12 @@ func (c *dbCache) Close() {
|
|||
c.closed = true
|
||||
}
|
||||
|
||||
func (c *dbCache) GetOrCreate(path string) *sharedDB {
|
||||
func (c *dbCache) GetOrCreate(ctx context.Context, path string) *sharedDB {
|
||||
value := c.getExisted(path)
|
||||
if value != nil {
|
||||
return value
|
||||
}
|
||||
return c.create(path)
|
||||
return c.create(ctx, path)
|
||||
}
|
||||
|
||||
func (c *dbCache) EvictAndMarkNonCached(path string) {
|
||||
|
@ -122,7 +122,7 @@ func (c *dbCache) getExisted(path string) *sharedDB {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *dbCache) create(path string) *sharedDB {
|
||||
func (c *dbCache) create(ctx context.Context, path string) *sharedDB {
|
||||
c.pathLock.Lock(path)
|
||||
defer c.pathLock.Unlock(path)
|
||||
|
||||
|
@ -133,7 +133,7 @@ func (c *dbCache) create(path string) *sharedDB {
|
|||
|
||||
value = c.dbManager.GetByPath(path)
|
||||
|
||||
_, err := value.Open() // open db to hold reference, closed by evictedDB.Close() or if cache closed
|
||||
_, err := value.Open(ctx) // open db to hold reference, closed by evictedDB.Close() or if cache closed
|
||||
if err != nil {
|
||||
return value
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue