Skip to content

Commit e75d776

Browse files
committed
bboltcachestorage: only delete link after releasing result
Signed-off-by: fanjiyun.fjy <[email protected]>
1 parent 2d69a25 commit e75d776

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

solver/bboltcachestorage/storage.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,10 @@ func (s *Store) emptyBranchWithParents(tx *bolt.Tx, id []byte) error {
278278
}
279279

280280
if isEmptyBucket(subLinks) {
281-
if err := tx.Bucket([]byte(linksBucket)).DeleteBucket(k); err != nil {
282-
return err
281+
if subResult := tx.Bucket([]byte(resultBucket)).Bucket(k); isEmptyBucket(subResult) {
282+
if err := tx.Bucket([]byte(linksBucket)).DeleteBucket(k); err != nil {
283+
return err
284+
}
283285
}
284286
}
285287
}

0 commit comments

Comments
 (0)