From 0866911b67f7d16d668c527aa3b317ab750e66f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasin=20B=C3=BCy=C3=BCktepe?= Date: Tue, 1 Sep 2026 01:03:27 +0300 Subject: [PATCH 1/2] feat(publisher): support configurable inline polling parameters for high-throughput batch publishing --- src/mesa_legal_data/publisher/engine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mesa_legal_data/publisher/engine.py b/src/mesa_legal_data/publisher/engine.py index e7065c8..4cf5e45 100644 --- a/src/mesa_legal_data/publisher/engine.py +++ b/src/mesa_legal_data/publisher/engine.py @@ -344,6 +344,8 @@ def execute_publish_delivery( expected_target_config_sha256: str | None = None, progress_callback: Callable[[dict[str, Any]], None] | None = None, is_cancelled_cb: Callable[[], bool] | None = None, + max_inline_polls: int = 5, + poll_interval_seconds: float = 0.5, ) -> dict[str, Any]: """ Executes an end-to-end MESA v4 publish delivery: @@ -499,7 +501,6 @@ def execute_publish_delivery( final_item_state = initial_state if initial_state in (MutationState.QUEUED.value, MutationState.PROCESSING.value): - # Poll mutation until terminal state update_delivery_item_state( conn, item_id=item_id, @@ -507,8 +508,9 @@ def execute_publish_delivery( remote_mutation_id=remote_mutation_id, ) poll_attempts = 0 - while poll_attempts < 5: - time.sleep(0.5) + while poll_attempts < max_inline_polls: + if poll_interval_seconds > 0: + time.sleep(poll_interval_seconds) poll_res = client.get_mutation_status(remote_mutation_id or "") polled_state = poll_res.get("state") if polled_state in ( From 4eb721a712e31aa27a5b48e243ade436e6da8dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasin=20B=C3=BCy=C3=BCktepe?= Date: Tue, 1 Sep 2026 02:32:19 +0300 Subject: [PATCH 2/2] fix(client): increase default timeout_seconds to 60.0s for durable delivery --- src/mesa_legal_data/publisher/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa_legal_data/publisher/client.py b/src/mesa_legal_data/publisher/client.py index 58cab4b..37c9daa 100644 --- a/src/mesa_legal_data/publisher/client.py +++ b/src/mesa_legal_data/publisher/client.py @@ -29,7 +29,7 @@ def __init__( self, settings: MesaTargetSettings, api_key: str | None = None, - timeout_seconds: float = 15.0, + timeout_seconds: float = 60.0, ): self.settings = settings self._api_key = api_key or os.environ.get("MESA_DATA_MESA_API_KEY") or os.environ.get("MESA_API_KEY")