diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-11-20 11:18:48 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-11-20 11:18:48 -0600 |
| commit | 2be43c17aba4d1bbc2cd88f9ad5adadebe7bb309 (patch) | |
| tree | ef45b9d9f12f65fd01aad4b4a92feb1e34f556c8 /src | |
| parent | 2e996421731c6024b6d3308ccfb0e0071bc4407b (diff) | |
| download | invidious-2be43c17aba4d1bbc2cd88f9ad5adadebe7bb309.tar.gz invidious-2be43c17aba4d1bbc2cd88f9ad5adadebe7bb309.tar.bz2 invidious-2be43c17aba4d1bbc2cd88f9ad5adadebe7bb309.zip | |
Sample proxies to avoid overloading single proxy
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/helpers/utils.cr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.cr index f1339749..496c3e0d 100644 --- a/src/invidious/helpers/utils.cr +++ b/src/invidious/helpers/utils.cr @@ -30,7 +30,7 @@ def make_client(url, proxies = {} of String => Array({ip: String, port: Int32}), client.connect_timeout = 10.seconds if region - proxies[region]?.try &.each do |proxy| + proxies[region]?.try &.sample(40).each do |proxy| begin proxy = HTTPProxy.new(proxy_host: proxy[:ip], proxy_port: proxy[:port]) client.set_proxy(proxy) |
