Improve server. ()

This commit is contained in:
Antonio Navarro Perez 2021-12-09 17:45:25 +01:00 committed by GitHub
parent 4444a44b7f
commit e90e6eaf1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 9 deletions
cmd/distribyted

View file

@ -116,7 +116,12 @@ func load(configPath string, port, webDAVPort int, fuseAllowOther bool) error {
return fmt.Errorf("error starting item store: %w", err)
}
c, err := torrent.NewClient(st, fis, conf.Torrent)
id, err := torrent.GetOrCreatePeerID(filepath.Join(conf.Torrent.MetadataFolder, "ID"))
if err != nil {
return fmt.Errorf("error creating node ID: %w", err)
}
c, err := torrent.NewClient(st, fis, conf.Torrent, id)
if err != nil {
return fmt.Errorf("error starting torrent client: %w", err)
}