Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wait wrapper around Batch V1/V2 user action calls until the status changes #549

Closed
wants to merge 7 commits into from

Conversation

mlubej
Copy link
Contributor

@mlubej mlubej commented Nov 7, 2024

  • Added a simple wrapper which first saves the old status before performing the action, then it repeatedly checks for a status update until the wait is over. if the status doesn't change, it logs a warning
  • added also for Batch V2
  • added mocked tests for both

@@ -29,6 +31,23 @@
BatchCollectionType = Union[str, dict, "BatchCollection"]


def batch_user_action_wait_for_status_change(func: Callable) -> Callable:
@wraps(func)
def retrying_func(self: SentinelHubBatch, batch_request: BatchRequest) -> Json:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zigaLuksic not sure about the self type here. It works for batch V1, but batch V2 in principle has a different class, which I don't import here, but mypy seems to be happy

@mlubej
Copy link
Contributor Author

mlubej commented Nov 8, 2024

Closing in favor of sentinel-hub/eo-grow#360

@mlubej mlubej closed this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant