mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 08:39:59 -05:00
Merge branch 'behavior_logging' into qa
This commit is contained in:
commit
0a1f20a04c
@ -33,6 +33,7 @@ from brozzler.chrome import Chrome
|
|||||||
import socket
|
import socket
|
||||||
import urlcanon
|
import urlcanon
|
||||||
|
|
||||||
|
MAX_UNMATCHED_INVALID_CHECKS = 5
|
||||||
|
|
||||||
class BrowsingException(Exception):
|
class BrowsingException(Exception):
|
||||||
pass
|
pass
|
||||||
@ -806,6 +807,16 @@ class Browser:
|
|||||||
|
|
||||||
brozzler.sleep(check_interval)
|
brozzler.sleep(check_interval)
|
||||||
|
|
||||||
|
if invalid_behavior_checks > valid_behavior_checks and invalid_behavior checks > MAX_UNMATCHED_INVALID_CHECKS:
|
||||||
|
logging.warn(
|
||||||
|
"behavior logged too many invalid checks, %s, after %.1fs and %s valid checks, for url %s",
|
||||||
|
elapsed,
|
||||||
|
valid_behavior_checks,
|
||||||
|
invalid_behavior_checks,
|
||||||
|
page_url,
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
self.websock_thread.expect_result(self._command_id.peek())
|
self.websock_thread.expect_result(self._command_id.peek())
|
||||||
msg_id = self.send_to_chrome(
|
msg_id = self.send_to_chrome(
|
||||||
method="Runtime.evaluate",
|
method="Runtime.evaluate",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user