[#1437] node: Fix contextcheck linter

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-10-21 16:27:28 +03:00
parent 6921a89061
commit 7429553266
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
209 changed files with 1068 additions and 1036 deletions

View file

@ -18,8 +18,8 @@ func (db *activeDB) Blobovnicza() *blobovnicza.Blobovnicza {
return db.blz
}
func (db *activeDB) Close() {
db.shDB.Close()
func (db *activeDB) Close(ctx context.Context) {
db.shDB.Close(ctx)
}
func (db *activeDB) SystemPath() string {
@ -73,12 +73,12 @@ func (m *activeDBManager) Open() {
m.closed = false
}
func (m *activeDBManager) Close() {
func (m *activeDBManager) Close(ctx context.Context) {
m.levelToActiveDBGuard.Lock()
defer m.levelToActiveDBGuard.Unlock()
for _, db := range m.levelToActiveDB {
db.Close()
db.Close(ctx)
}
m.levelToActiveDB = make(map[string]*sharedDB)
m.closed = true
@ -103,7 +103,7 @@ func (m *activeDBManager) getCurrentActiveIfOk(ctx context.Context, lvlPath stri
}
if blz.IsFull() {
db.Close()
db.Close(ctx)
return nil, nil
}
@ -168,10 +168,10 @@ func (m *activeDBManager) getNextSharedDB(ctx context.Context, lvlPath string) (
previous, updated := m.replace(lvlPath, next)
if !updated && next != nil {
next.Close() // manager is closed, so don't hold active DB open
next.Close(ctx) // manager is closed, so don't hold active DB open
}
if updated && previous != nil {
previous.Close()
previous.Close(ctx)
}
return next, nil
}