mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Randomly refresh HTTP clients
This commit is contained in:
parent
61e3b47210
commit
f77dcb7f9b
1 changed files with 5 additions and 2 deletions
|
@ -21,9 +21,12 @@ end
|
|||
# Refresh all the connections in the pool by crawling recommended
|
||||
spawn do
|
||||
# Arbitrary start value
|
||||
id = Deque.new(50,"0xjKNDMgE54")
|
||||
id = Deque.new(50, "0xjKNDMgE54")
|
||||
while true
|
||||
client = get_client
|
||||
if rand(30) > 1
|
||||
client = HTTP::Client.new(URL, CONTEXT)
|
||||
end
|
||||
time = Time.now
|
||||
|
||||
begin
|
||||
|
|
Loading…
Reference in a new issue