mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 21:46:11 +05:00
add dht limit
This commit is contained in:
@@ -18,8 +18,8 @@ func init() {
|
||||
sets.CacheSize = 200 * 1024 * 1024
|
||||
sets.PreloadBufferSize = 20 * 1024 * 1024
|
||||
sets.ConnectionsLimit = 100
|
||||
sets.DhtConnectionLimit = 500
|
||||
sets.RetrackersMode = 1
|
||||
sets.DisableDHT = true
|
||||
StartTime = time.Now()
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ type Settings struct {
|
||||
DownloadRateLimit int // in kb, 0 - inf
|
||||
UploadRateLimit int // in kb, 0 - inf
|
||||
ConnectionsLimit int
|
||||
DhtConnectionLimit int // 0 - inf
|
||||
PeersListenPort int
|
||||
}
|
||||
|
||||
@@ -74,7 +75,10 @@ func ReadSettings() error {
|
||||
return err
|
||||
}
|
||||
if sets.ConnectionsLimit <= 0 {
|
||||
sets.ConnectionsLimit = 50
|
||||
sets.ConnectionsLimit = 100
|
||||
}
|
||||
if sets.DhtConnectionLimit < 0 {
|
||||
sets.DhtConnectionLimit = 500
|
||||
}
|
||||
if sets.CacheSize <= 0 {
|
||||
sets.CacheSize = 200 * 1024 * 1024
|
||||
|
||||
Reference in New Issue
Block a user