-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fixes consumables' checkout 500 error and memory exhaustion #15785
base: develop
Are you sure you want to change the base?
Conversation
PR Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment about something we might want to change but good other than that 👍🏾
event(new CheckoutableCheckedOut($consumable, $user, auth()->user(), $request->input('note'))); | ||
}); | ||
}catch(\Exception $e){ | ||
report ($e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only thing that we might not want to include. I'll leave it up to @snipe.
Description
This fixes the 500 error upon consumable checkout and adds try/catch around the array creation and db transaction.
Speaking of a DB transaction, this refactors the store method by cutting back on querying the users table too many times and utilizes a DB transaction.
This also caps the checkout quantity to 10 thousand. Performance gets shotty above that and can error sometimes.
If an error occurs or memory exhaustion it will no longer 500 but return an error message:
Fixes #[sc-27379]
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: