New Expandable file formats ()

This commit is contained in:
Antonio Navarro Perez 2021-11-29 11:07:54 +01:00 committed by GitHub
parent 15c72452de
commit 8d9a9281c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 808 additions and 346 deletions
cmd/distribyted

View file

@ -148,9 +148,12 @@ func load(configPath string, port, webDAVPort int, fuseAllowOther bool) error {
return fmt.Errorf("error starting magnet database: %w", err)
}
ts := torrent.NewService(cl, dbl, ss, c, conf.Torrent.AddTimeout)
ts := torrent.NewService(cl, dbl, ss, c, conf.Torrent.AddTimeout, conf.Torrent.ReadTimeout)
mh := fuse.NewHandler(fuseAllowOther || conf.Fuse.AllowOther, conf.Fuse.Path)
var mh *fuse.Handler
if conf.Fuse != nil {
mh = fuse.NewHandler(fuseAllowOther || conf.Fuse.AllowOther, conf.Fuse.Path)
}
sigChan := make(chan os.Signal)
signal.Notify(sigChan, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
@ -170,8 +173,10 @@ func load(configPath string, port, webDAVPort int, fuseAllowOther bool) error {
dbl.Close()
log.Info().Msg("closing torrent client...")
c.Close()
log.Info().Msg("unmounting fuse filesystem...")
mh.Unmount()
if mh != nil {
log.Info().Msg("unmounting fuse filesystem...")
mh.Unmount()
}
log.Info().Msg("exiting")
os.Exit(1)
@ -186,6 +191,10 @@ func load(configPath string, port, webDAVPort int, fuseAllowOther bool) error {
}
go func() {
if mh == nil {
return
}
if err := mh.Mount(fss); err != nil {
log.Info().Err(err).Msg("error mounting filesystems")
}