Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/mesa_legal_data/publisher/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 5 additions & 3 deletions src/mesa_legal_data/publisher/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines +347 to +348
) -> dict[str, Any]:
"""
Executes an end-to-end MESA v4 publish delivery:
Expand Down Expand Up @@ -499,16 +501,16 @@ 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,
remote_state=MutationState.PROCESSING.value,
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 (
Expand Down
Loading