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
Fixed #7824 #10494
Fixed #7824 #10494
Conversation
Previously there was a 999 max seats on Licenses as anything above that seemed to cause slowdowns and failure. This commit allievates those pain points - removed freeSeats as a hydrated Eloquent model on JSON requests for the licenses index - removed 'licenseSeats.user', 'licenseSeats.asset' from the 'with' clause as it's not needed in the view (Datatabales takes care of that) - removed the 999 max seats limit from the License Model, - reworked how new license seats are created when increasing seats or creating licenses - Added an index the license_seats table to help speed up lookups
Please take a good look at the Licenses at the changes around line 180 on License.php That's the only chunk of code that I'm iffy on it being up to your standards. |
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 looks AWESOME. I do have a few questions which I'd love for you to address, then I'll definitely do the work of getting this integrated as quickly as I can.
I always had the suspicion that if I looked at Licenses hard enough, that eventually whatever was mucking us up would dissipate. I think you actually did that work, so thank you!
app/Models/License.php
Outdated
@@ -10,6 +10,7 @@ | |||
use Illuminate\Database\Eloquent\SoftDeletes; | |||
use Illuminate\Support\Facades\Auth; | |||
use Illuminate\Support\Facades\Session; | |||
use phpDocumentor\Reflection\Types\Collection; |
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 smells funny, are we sure this is right?
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.
I saw that right after I pushed. PHPStorm added that and I didn't notice it.
👃 bad smell lol
public function up() | ||
{ | ||
Schema::table('license_seats', function (Blueprint $table) { | ||
$table->index(['license_id']); |
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.
BOOM! Nice :)
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 looks GREAT. Let me chat with the boss and see if we can get this tested, then merged.
Thank you!
Previously there was a 999 max seats on Licenses as anything above that seemed to cause slowdowns and failure.
This commit allievates those pain points
I test created about 1000 licenses with 20,000 seats each and things were zooming alone nicely.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context, providing screenshots where practical. List any dependencies that are required for this change.
Fixes # (issue)
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: