|
18 | 18 |
|
19 | 19 | _WORKER_SPHINX_EXT_MODULE_NAME = "bazel_worker_sphinx_ext" |
20 | 20 |
|
| 21 | +# Config value name for getting the path to the request info file |
| 22 | +_REQUEST_INFO_CONFIG_NAME = "bazel_worker_request_info_path" |
| 23 | + |
21 | 24 |
|
22 | 25 | class Worker: |
23 | 26 |
|
@@ -75,7 +78,7 @@ def run(self) -> None: |
75 | 78 | except Exception: |
76 | 79 | logger.exception("Unhandled error: request=%s", request) |
77 | 80 | output = ( |
78 | | - f"Unhandled error:\nRequest: {request}\n" |
| 81 | + f"Unhandled error:\nRequest id: {request.get('id')}\n" |
79 | 82 | + traceback.format_exc() |
80 | 83 | ) |
81 | 84 | request_id = 0 if not request else request.get("requestId", 0) |
@@ -133,7 +136,7 @@ def _prepare_sphinx(self, request): |
133 | 136 | request_info_path = os.path.join(srcdir, "_bazel_worker_request_info.json") |
134 | 137 | with open(request_info_path, "w") as fp: |
135 | 138 | json.dump(request_info, fp) |
136 | | - sphinx_args.append(f"--define=bazel_worker_request_info={request_info_path}") |
| 139 | + sphinx_args.append(f"--define={_REQUEST_INFO_CONFIG_NAME}={request_info_path}") |
137 | 140 |
|
138 | 141 | return worker_outdir, bazel_outdir, sphinx_args |
139 | 142 |
|
@@ -192,6 +195,7 @@ def __init__(self): |
192 | 195 | self.changed_paths = set() |
193 | 196 |
|
194 | 197 | def setup(self, app): |
| 198 | + app.add_config_value(_REQUEST_INFO_CONFIG_NAME, "", "") |
195 | 199 | app.connect("env-get-outdated", self._handle_env_get_outdated) |
196 | 200 | return {"parallel_read_safe": True, "parallel_write_safe": True} |
197 | 201 |
|
|
0 commit comments