mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-04-20 15:55:49 -04:00
fix: bind worker_id inside BrozzlerWorker
This ensures the parameter remains available within a multithreaded context.
This commit is contained in:
parent
bae29f7b9b
commit
c9c9bda869
@ -369,6 +369,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):
|
||||
@ -701,6 +702,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)
|
||||
|
@ -81,6 +81,7 @@ class BrozzlerWorker:
|
||||
metrics_port=0,
|
||||
registry_url=None,
|
||||
env=None,
|
||||
worker_id=None,
|
||||
):
|
||||
self._frontier = frontier
|
||||
self._service_registry = service_registry
|
||||
@ -95,6 +96,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)
|
||||
|
||||
# We definitely shouldn't ytdlp if the optional extra is missing
|
||||
try:
|
||||
import yt_dlp
|
||||
|
Loading…
x
Reference in New Issue
Block a user