Skip to content

Commit ecf19ca

Browse files
committed
refactor: simplify Close method
1 parent daed3b8 commit ecf19ca

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

internal/cache/cache.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,10 @@ func NewCache(sw *timeutils.Stopwatch, log logutils.Log) (*Cache, error) {
5252
}
5353

5454
func (c *Cache) Close() {
55-
c.sw.TrackStage("close", func() {
56-
err := c.lowLevelCache.Close()
57-
if err != nil {
58-
c.log.Errorf("cache close: %v", err)
59-
}
60-
})
55+
err := c.sw.TrackStageErr("close", c.lowLevelCache.Close)
56+
if err != nil {
57+
c.log.Errorf("cache close: %v", err)
58+
}
6159
}
6260

6361
func (c *Cache) Put(pkg *packages.Package, mode HashMode, key string, data any) error {

0 commit comments

Comments
 (0)