New Expandable file formats (#95)
This commit is contained in:
parent
15c72452de
commit
8d9a9281c9
26 changed files with 808 additions and 346 deletions
cmd/distribyted
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue