mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-06-22 22:04:13 -04:00
sleep for 5 seconds after starting a browser, since starting 20 at once brings the computer to its knees
This commit is contained in:
parent
1f91018d91
commit
e619e013b6
1 changed files with 6 additions and 2 deletions
|
@ -106,11 +106,15 @@ class AmqpBrowserController:
|
||||||
consumer.callbacks = [self._make_callback(browser)]
|
consumer.callbacks = [self._make_callback(browser)]
|
||||||
conn.drain_events(timeout=0.5)
|
conn.drain_events(timeout=0.5)
|
||||||
consumer.callbacks = None
|
consumer.callbacks = None
|
||||||
|
|
||||||
|
# browser startup is a heavy operation, so do
|
||||||
|
# it once every 5 seconds at most
|
||||||
|
time.sleep(5)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# no browsers available
|
# thrown by self._browser_pool.acquire() - no browsers available
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
except socket.timeout:
|
except socket.timeout:
|
||||||
# no urls in the queue
|
# thrown by conn.drain_events(timeout=0.5) - no urls in the queue
|
||||||
self._browser_pool.release(browser)
|
self._browser_pool.release(browser)
|
||||||
|
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue