Skip to content

feat: makes polling interval configurable#13

Merged
zvikagart merged 3 commits intocodeocean:mainfrom
jtyoung84:feat-11-configurable-polling
Oct 15, 2024
Merged

feat: makes polling interval configurable#13
zvikagart merged 3 commits intocodeocean:mainfrom
jtyoung84:feat-11-configurable-polling

Conversation

@jtyoung84
Copy link
Contributor

Closes #11

  • Makes the polling interval configurable so users can increase the interval for long running computations
  • Sets 5 as the default to be backwards compatible
  • Adds an assert so users can't decrease the interval below 5

Copy link
Contributor

@zvikagart zvikagart left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

"""
Polls the given computation until it reaches the 'Completed' or 'Failed' state.
"""
assert polling_interval >= 5, "polling_interval should be greater than or equal to 5"
Copy link
Contributor

Choose a reason for hiding this comment

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

Raising a ValueError is preferable over assertions. The latter is more for debugging.

@jtyoung84 jtyoung84 requested a review from zvikagart October 14, 2024 16:37
@zvikagart zvikagart merged commit 39fe85e into codeocean:main Oct 15, 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.

Make polling interval configurable

2 participants