0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

fix upload speed throttling

This commit is contained in:
tnothy 2024-07-29 21:46:25 +02:00
parent 07c0a804d7
commit 8681a4dc6d

View file

@ -225,8 +225,8 @@ func New(ops Options) (c *Client, err error) {
panic("Could not parse given Upload Limit") panic("Could not parse given Upload Limit")
} }
} }
// Somehow 4* is necessary
rt = rate.Every(time.Second / (4 * time.Duration(uploadLimit))) rt = rate.Every(time.Second / time.Duration(uploadLimit))
if int(uploadLimit) > minBurstSize { if int(uploadLimit) > minBurstSize {
minBurstSize = int(uploadLimit) minBurstSize = int(uploadLimit)
} }