Performance middleware; improve trigger perf; add cart_full
#740
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.
Improve trigger performance, add
cart_full
during the lifetime of the context. This allows us to call something
like
Trigger.gather
(which uses datasets) multiple times,but only call the database once.
which would be prohibited at checkout due to offering item limits.
Instead, whenever we add a cart item, we return the full offering,
(which contains the cart), rather than just the cart.
max_quantity_for
take into accountthe items already in the cart.
has a zero quantity because it's out of stock (or unavailable
because the user has already ordered too much),
or whether it's zero quantity because they can't add any more of it
because of what's in the current cart.
Use dynamic translation on order history
Add performance middleware
For each request, log out things like the total number of
sql queries and time spent in the database+driver.
At higher levels of logging,
also print out all the duplicate/similar queries.