mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-08 14:32:23 -04:00
log ports chose for browsers, and give threads nice names to make logs easier to understand
This commit is contained in:
parent
2c4ba005b5
commit
b67d9fadf0
2 changed files with 14 additions and 3 deletions
|
@ -65,7 +65,7 @@ class AmqpBrowserController:
|
|||
self._producer_conn = kombu.Connection(self.amqp_url)
|
||||
self._producer = self._producer_conn.Producer(serializer='json')
|
||||
|
||||
self._amqp_thread = threading.Thread(target=self._consume_amqp)
|
||||
self._amqp_thread = threading.Thread(target=self._consume_amqp, name='AmqpConsumerThread')
|
||||
self._amqp_stop = threading.Event()
|
||||
self._amqp_thread.start()
|
||||
|
||||
|
@ -139,5 +139,8 @@ class AmqpBrowserController:
|
|||
browser.browse_page(url, on_request=on_request)
|
||||
self._browser_pool.release(browser)
|
||||
|
||||
threading.Thread(target=browse_page_async).start()
|
||||
import random
|
||||
threadName = "BrowsingThread{}-{}".format(browser.chrome_port,
|
||||
''.join((random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789') for _ in range(6))))
|
||||
threading.Thread(target=browse_page_async, name=threadName).start()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue