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

API to wait for ingest status changes #34

Closed
bjchambers opened this issue Jan 29, 2024 · 2 comments · Fixed by #76
Closed

API to wait for ingest status changes #34

bjchambers opened this issue Jan 29, 2024 · 2 comments · Fixed by #76
Assignees
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@bjchambers
Copy link
Contributor

Currently, we support GET /documents/{id} to get the status of a document. It would be nice if we could have something like GET /documents/{id}?wait_for_terminal=True or something, which would cause the wait to happen in the server rather than looping in the client.

Specifically, we can use postgres notifications to wake up threads on the server that are waiting for specific document ingestion updates, so this would let us avoid polling entirely.

@bjchambers bjchambers added the enhancement New feature or request label Jan 29, 2024
@bjchambers
Copy link
Contributor Author

This may not be ideal. While it might be useful, it would require the client set a high timeout for this method call. Many libraries don't make it easy to set per-call timeouts, so you'd need to mutate the client or set it high for all calls, which in turn wouldn't detect legitimate errors quickly. Perhaps the best option here is to actually have the client periodically call GET /documents/{id} and see if it is done. That should call should be quick.

@bjchambers bjchambers self-assigned this Feb 2, 2024
@bjchambers bjchambers linked a pull request Feb 4, 2024 that will close this issue
@bjchambers
Copy link
Contributor Author

Closing -- the goal of making it easier to wait for a specific status is accomplished with the more specific endpoint, while as noted having a "long" REST method seems not desirable at this time

@bjchambers bjchambers closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2024
@bjchambers bjchambers added the wontfix This will not be worked on label Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant