Documentation
¶
Index ¶
Constants ¶
View Source
const ( NEW_TORRENTS_TIMESPAN = int64(15 * 60) // new torrents timespan during which will NOT be examined at all NEW_TORRENTS_STALL_EXEMPTION_TIMESPAN = int64(30 * 60) // new torrents timespan during which will NOT be stalled NO_PROCESS_TORRENT_DELETEION_TIMESPAN = int64(30 * 60) STALL_DOWNLOAD_SPEED = int64(10 * 1024) SLOW_UPLOAD_SPEED = int64(100 * 1024) RATIO_CHECK_MIN_DOWNLOAD_SPEED = int64(100 * 1024) SLOW_TORRENTS_CHECK_TIMESPAN = int64(15 * 60) STALL_TORRENT_DELETEION_TIMESPAN = int64(30 * 60) // stalled torrent will be deleted after this time passed BANDWIDTH_FULL_PERCENT = float64(0.8) DELETE_TORRENT_IMMEDIATELY_STORE = float64(99999) RESUME_TORRENTS_FREE_DISK_SPACE_TIER = int64(5 * 1024 * 1024 * 1024) // 5GB )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlgorithmAddTorrent ¶
type AlgorithmModifyTorrent ¶
type AlgorithmResult ¶
type AlgorithmResult struct {
DeleteTorrents []AlgorithmOperationTorrent // torrents that will be removed from client
StallTorrents []AlgorithmModifyTorrent // torrents that will stop downloading but still uploading
ResumeTorrents []AlgorithmOperationTorrent // resume paused / errored torrents
ModifyTorrents []AlgorithmModifyTorrent // modify meta info of these torrents
AddTorrents []AlgorithmAddTorrent // new torrents that will be added to client
CanAddMore bool // client is able to add more torrents
FreeSpaceChange int64 // estimated free space change after apply above operations
Msg string
}
func Decide ¶
func Decide(clientStatus *client.Status, clientTorrents []client.Torrent, siteTorrents []site.Torrent, option *BrushOptionStruct) (result *AlgorithmResult)
* Strategy * Delete a torrent from client ONLY when it's uploading speed become SLOW enough AND free disk space insufficient. * Stall ALL torrent of client (limit download speed to 1B/s, so upload only) when free disk space insufficient * Add new torrents to client when server uploading bandwidth is somewhat idle AND there is SOME free disk space. *
Click to show internal directories.
Click to hide internal directories.