[#1437] blobovnicza: Fix contextcheck linter

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-10-21 11:20:17 +03:00
parent 6db46257c0
commit 62b5181618
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
22 changed files with 82 additions and 81 deletions

View file

@ -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
}