mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-09-18 11:44:36 -04:00
random.choice
This commit is contained in:
parent
af39b8cc6f
commit
d190122a6d
1 changed files with 2 additions and 1 deletions
|
@ -28,6 +28,7 @@ import json
|
|||
import PIL.Image
|
||||
import io
|
||||
import socket
|
||||
import random
|
||||
import requests
|
||||
import doublethink
|
||||
import tempfile
|
||||
|
@ -82,7 +83,7 @@ class BrozzlerWorker:
|
|||
return None
|
||||
warcproxes.sort(key=lambda warcprox: (warcprox['load']))
|
||||
# XXX make this heuristic more advanced?
|
||||
return warcproxes[0]
|
||||
return random.choice(warcproxes[0:5])
|
||||
|
||||
def _proxy_for(self, site):
|
||||
if self._proxy:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue