Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wrote this endpoint over 2 years ago while integrating identifier
minting and barcode label generation, only to end up refactoring the
bulk of it out and generating labels via a CLI command instead. With a
web interface for minting new identifiers in mind, I kept the code
around as a wip branch. I thought of it again as we're thinking about
identifier API integration with the BBI LIMS, so I updated the code to
account for changes that happened in the interim.
We should consider what limits on "n" (if any?) are appropriate. I'm
not sure what reasonable bound would be. Here's the current summary
stats of batch size for all we've minted so far:
Stepping back from n, I think what a limit would really seek to prevent
is minting reqs that run "forever". We can't guarantee this just through
n alone (although very small n might approximate it well enough), so
maybe the more appropriate thing would be an explicit time limit. There
is some existing limit on request/response duration already at the web
server level (both at uWSGI and Apache, I believe), so that may provide
enough of a time limit if the corresponding database session is
terminated when the request is. But I'm not sure that's the case.
This also means that we may not be able to use this API as-is to mint
large batches of identifiers without increasing existing
request/response duration limits, possibly to unreasonable levels. An
async API would obviate that issue, but then require a minting job queue
and polling of job status by the client. (We've talked about this in the
past in related convos.)
(Extracted from #230 after discussion.)