mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
chore: fix linter issues.
This commit is contained in:
@ -231,7 +231,7 @@ func downloadAttachment(ctx context.Context, cache *DownloadCache, client APICli
|
||||
}
|
||||
|
||||
type DownloadRateModifier interface {
|
||||
Apply(wasSuccess bool, current int, max int) int //nolint:predeclared
|
||||
Apply(wasSuccess bool, currentValue int, maxValue int) int
|
||||
}
|
||||
|
||||
func autoDownloadRate[T any, R any](
|
||||
@ -285,14 +285,14 @@ func autoDownloadRate[T any, R any](
|
||||
|
||||
type DefaultDownloadRateModifier struct{}
|
||||
|
||||
func (d DefaultDownloadRateModifier) Apply(wasSuccess bool, current int, max int) int { //nolint:predeclared
|
||||
func (d DefaultDownloadRateModifier) Apply(wasSuccess bool, currentValue int, maxValue int) int {
|
||||
if !wasSuccess {
|
||||
return 2
|
||||
}
|
||||
|
||||
parallelTasks := current * 2
|
||||
if parallelTasks > max {
|
||||
parallelTasks = max
|
||||
parallelTasks := currentValue * 2
|
||||
if parallelTasks > maxValue {
|
||||
parallelTasks = maxValue
|
||||
}
|
||||
|
||||
return parallelTasks
|
||||
|
||||
Reference in New Issue
Block a user