Skip to content

Commit

Permalink
feat: add log for long brozzler sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-miller committed Dec 12, 2024
1 parent 73a9c9f commit 7ef4a04
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions brozzler/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,9 +572,16 @@ def brozzle_site(self, browser, site):
page.save()
finally:
if start:
seconds_elapsed = time.time() - start
site.active_brozzling_time = (
(site.active_brozzling_time or 0) + time.time() - start
)
site.active_brozzling_time or 0
) + seconds_elapsed
if seconds_elapsed > (30 * 60):
self.logger.warning(
"Page took %s seconds to complete: %s",
seconds_elapsed,
page.url,
)
self._frontier.disclaim_site(site, page)

def _brozzle_site_thread_target(self, browser, site):
Expand Down

0 comments on commit 7ef4a04

Please sign in to comment.