mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-18 23:06:01 -04:00
Merge pull request #345 from mistydemeo/fix_worker_id
Some checks are pending
Python Formatting Check / formatting (push) Waiting to run
Some checks are pending
Python Formatting Check / formatting (push) Waiting to run
fix: bind worker_id inside BrozzlerWorker
This commit is contained in:
commit
3ef0c3abc9
@ -368,6 +368,7 @@ def brozzle_page(argv=None):
|
||||
metrics_port=args.metrics_port,
|
||||
registry_url=args.registry_url,
|
||||
env=args.env,
|
||||
worker_id=args.worker_id,
|
||||
)
|
||||
|
||||
def on_screenshot(screenshot_jpeg):
|
||||
@ -717,6 +718,7 @@ def brozzler_worker(argv=None):
|
||||
metrics_port=args.metrics_port,
|
||||
registry_url=args.registry_url,
|
||||
env=args.env,
|
||||
worker_id=args.worker_id,
|
||||
)
|
||||
|
||||
signal.signal(signal.SIGQUIT, dump_state)
|
||||
|
@ -82,6 +82,7 @@ class BrozzlerWorker:
|
||||
metrics_port=0,
|
||||
registry_url=None,
|
||||
env=None,
|
||||
worker_id=None,
|
||||
):
|
||||
self._frontier = frontier
|
||||
self._service_registry = service_registry
|
||||
@ -97,6 +98,9 @@ class BrozzlerWorker:
|
||||
self._skip_visit_hashtags = skip_visit_hashtags
|
||||
self._skip_youtube_dl = skip_youtube_dl
|
||||
|
||||
if worker_id is not None:
|
||||
self.logger = self.logger.bind(worker_id=worker_id)
|
||||
|
||||
# TODO try using importlib.util.find_spec to test for dependency
|
||||
# presence rather than try/except on import.
|
||||
# See https://docs.astral.sh/ruff/rules/unused-import/#example
|
||||
|
Loading…
x
Reference in New Issue
Block a user