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

Should be an exception you can raise that cancels or pauses the run #36

Closed
simonw opened this issue Nov 30, 2023 · 3 comments
Closed

Should be an exception you can raise that cancels or pauses the run #36

simonw opened this issue Nov 30, 2023 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@simonw
Copy link
Collaborator

simonw commented Nov 30, 2023

If you start getting API key authentication errors for example it's probably best to cancel the whole run rather than trigger the same error for every following batch.

Maybe this:

from datasette_enrichments import CancelException

raise CancelException("Run cancelled due to API authentication error")
@simonw simonw added the enhancement New feature or request label Nov 30, 2023
@simonw
Copy link
Collaborator Author

simonw commented Nov 30, 2023

@simonw simonw added this to the 0.5 milestone Jan 13, 2025
@simonw simonw changed the title Should be an exception you can raise that cancels the run Should be an exception you can raise that cancels or pauses the run Jan 14, 2025
@simonw
Copy link
Collaborator Author

simonw commented Jan 14, 2025

The case for a "pause" exception is for something like the LLM enrichments where tokens might run out (or rate limits hit) - at which point the plugin could pause the enrichment run and wait for the user to top up.

Might need a "pause reason" in that case.

@simonw
Copy link
Collaborator Author

simonw commented Jan 15, 2025

@simonw simonw closed this as completed Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant