Skip to content

Commit

Permalink
Remove shutdown hook
Browse files Browse the repository at this point in the history
  • Loading branch information
darenliang committed Feb 6, 2023
1 parent f495bd9 commit 0447065
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import (
"github.com/valyala/fasthttp/pprofhandler"
"go.uber.org/zap"
"gopkg.in/alecthomas/kingpin.v2"
"os"
"os/signal"
"sync/atomic"
"syscall"
)

var (
Expand Down Expand Up @@ -90,15 +87,5 @@ func main() {

host := fuse.NewFileSystemHost(dsfs)
host.SetCapReaddirPlus(true)
go func() { host.Mount(mount, FuseArgs(options)) }()

// Wait for signal to shutdown
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, os.Kill, syscall.SIGTERM)
<-c
zap.S().Info("starting shutdown")
for _, fileData := range dsfs.open {
fileData.cache.Rm()
}
zap.S().Info("finished shutdown")
host.Mount(mount, FuseArgs(options))
}

0 comments on commit 0447065

Please sign in to comment.