Skip to content

Commit 91f35ae

Browse files
authored
Fix close errors (#380)
1 parent 53cb40b commit 91f35ae

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/litefs/mount_linux.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/superfly/litefs/fly"
2323
"github.com/superfly/litefs/fuse"
2424
"github.com/superfly/litefs/http"
25+
"github.com/superfly/litefs/internal"
2526
"github.com/superfly/litefs/lfsc"
2627
"golang.org/x/exp/slog"
2728
"gopkg.in/natefinch/lumberjack.v2"
@@ -172,13 +173,13 @@ func IsValidLeaseType(s string) bool {
172173

173174
func (c *MountCommand) Close() (err error) {
174175
if c.ProxyServer != nil {
175-
if e := c.ProxyServer.Close(); err == nil {
176+
if e := internal.Close(c.ProxyServer); err == nil {
176177
err = e
177178
}
178179
}
179180

180181
if c.HTTPServer != nil {
181-
if e := c.HTTPServer.Close(); err == nil {
182+
if e := internal.Close(c.HTTPServer); err == nil {
182183
err = e
183184
}
184185
}
@@ -190,7 +191,7 @@ func (c *MountCommand) Close() (err error) {
190191
}
191192

192193
if c.Store != nil {
193-
if e := c.Store.Close(); err == nil {
194+
if e := internal.Close(c.Store); err == nil {
194195
err = e
195196
}
196197
}

0 commit comments

Comments
 (0)