This commit is contained in:
YouROK
2021-05-17 14:55:57 +03:00
parent 29f13fd482
commit e578628886
40 changed files with 1319 additions and 656 deletions

View File

@@ -8,9 +8,11 @@ import (
type BTSets struct {
// Cache
CacheSize int64 // in byte, def 200 mb
PreloadBuffer bool
ReaderReadAHead int // in percent, 5%-100%, [...S__X__E...] [S-E] not clean
CacheSize int64 // in byte, def 200 mb
PreloadBuffer bool
ReaderReadAHead int // in percent, 5%-100%, [...S__X__E...] [S-E] not clean
UseDisk bool
TorrentsSavePath string
// Torrent
ForceEncrypt bool
@@ -83,9 +85,9 @@ func SetDefault() {
sets := new(BTSets)
sets.EnableDebug = false
sets.DisableUTP = true
sets.CacheSize = 100 * 1024 * 1024 // 100mb
sets.CacheSize = 96 * 1024 * 1024 // 100mb
sets.PreloadBuffer = false
sets.ConnectionsLimit = 25
sets.ConnectionsLimit = 23
sets.DhtConnectionLimit = 500
sets.RetrackersMode = 1
sets.TorrentDisconnectTimeout = 30

View File

@@ -4,8 +4,9 @@ import (
"path/filepath"
"strings"
bolt "go.etcd.io/bbolt"
"server/log"
bolt "go.etcd.io/bbolt"
)
type TDB struct {
@@ -99,7 +100,6 @@ func (v *TDB) Set(xpath, name string, value []byte) {
log.TLogln("value:", value)
}
return
}
func (v *TDB) List(xpath string) []string {
@@ -173,5 +173,4 @@ func (v *TDB) Rem(xpath, name string) {
log.TLogln("Error rem sets", xpath+"/"+name, ", error:", err)
}
return
}