Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/config/metainfo_fetcher.go
tomleb babf0a37f0 Cleanups and fixes (#623)
* Keep naming consistent

* Remove execute bit from files

* Default to DefaultLanguage (without passing it to the func)

* Remove commented code

* Use Content-Type to get language json

* Lines of 400 characters is dumb

* Update new repo in README

* Remove useless script since we fallback to a defaultlang

* Fix fallback language panic

* Fix uninitialized MaxPerPage when not in querystr

The issue was that the req.MaxPerPage was not set (default to 0) when
the query string didn't include "max". This makes the server query the
whole db since the resulting limit is 0.

* Fix creating empty torrents (only worked once)

* Lines of 400 characters is still dumb
2017-05-19 12:55:59 +10:00

27 lignes
803 o
Go

package config
type MetainfoFetcherConfig struct {
QueueSize int `json:"queue_size"`
Timeout int `json:"timeout"`
MaxDays int `json:"max_days"`
BaseFailCooldown int `json:"base_fail_cooldown"`
MaxFailCooldown int `json:"max_fail_cooldown"`
WakeUpInterval int `json:"wake_up_interval"`
UploadRateLimiter int `json:"upload_rate_limiter"`
DownloadRateLimiter int `json:"download_rate_limiter"`
}
var DefaultMetainfoFetcherConfig = MetainfoFetcherConfig{
QueueSize: 10,
Timeout: 120, // 2 min
MaxDays: 90,
BaseFailCooldown: 30 * 60, // in seconds, when failed torrents will be able to be fetched again.
MaxFailCooldown: 48 * 60 * 60,
WakeUpInterval: 300, // 5 min
UploadRateLimiter: 1024, // kbps
DownloadRateLimiter: 1024,
}