You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I work on an application where price calculation is dynamic and expense computationally. While trying to optimize my application code, I found that check_basket_is_valid does not use the cached purchase_info property available for basket lines. Because of this, I have certain Django views that are doing redundant work.
Since it calls fetch_for_line directly, it bypasses the proxying work and cache that Line.purchase_info provides.
The text was updated successfully, but these errors were encountered:
This won't work since availability and stockrecord will be cached, and then, if we allocate remaining number of the stock record and it becomes unavailable - check_basket_is_valid would still pass.
Closing since my test proofs appropriateness of current implementation. If you have other suggestion for performance improvement - please open a new issue. Thanks!
I work on an application where price calculation is dynamic and expense computationally. While trying to optimize my application code, I found that
check_basket_is_valid
does not use the cachedpurchase_info
property available for basket lines. Because of this, I have certain Django views that are doing redundant work.Since it calls
fetch_for_line
directly, it bypasses the proxying work and cache thatLine.purchase_info
provides.The text was updated successfully, but these errors were encountered: