invalidate stale carts, releasing the inventory. Set to 5 minutes dynamic, 30 minutes static. Seems 1ms per cart to delete assuming basket size of 1 and no changes after initial, which is fine. setInterval is worse for average and best case compared to setTimeout to when a cart is expected to expire, but worst case is better for setInterval. Consider multiple carts created within a second. With setTimeout, the query would be ran multiple times a second, compounding on the already heavy load.

Created by  boogerlad  on April 17, 2020
X2VJ3NUGYJVYW3QCHNX6HX2M4QTV6TPKRVHVTYH6FPXMN2DDTLMAC
Change contents