wait for a browser to become available and start it up before reading the next url from amqp; ack the message only after completing the browsing process successfully, and requeue if it's not successful; some refactoring to make the timing work for this

This commit is contained in:
Noah Levitt 2014-06-09 13:15:05 -07:00
parent e3c23a0f2b
commit a78e60f1da
4 changed files with 145 additions and 78 deletions

View file

@ -24,7 +24,7 @@ args = arg_parser.parse_args(args=sys.argv[1:])
logging.basicConfig(stream=sys.stdout, level=args.log_level,
format='%(asctime)s %(process)d %(levelname)s %(threadName)s %(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s')
browser = umbra.Browser(chrome_exe=args.chrome_exe, chrome_wait=args.browser_wait)
for url in args.urls:
browser.browse_page(url)
with umbra.Browser(chrome_exe=args.chrome_exe, chrome_wait=args.browser_wait) as browser:
for url in args.urls:
browser.browse_page(url)