Performance improvements for the Site Configurations when completion is enabled - #486
Conversation
5c3a453 to
ba2b92e
Compare
|
Are we positive that |
There was a problem hiding this comment.
@OmarIthawi I'm a bit worried about how this approach affects enterprise or normal edX installations (if we want to push upstream) because is gonna pull SiteConfiguration.objects.all() on every course the user is enrolled in, every-time a user reach the dashboard.
There was a problem hiding this comment.
Good point, @melvinsoft . A couple of questions for @OmarIthawi and/or @melvinsoft
A. Does it make sense to add a tahoe/multisite env flag for this?
B. Where is the source of 'course_org_filter'? I've looked over the SiteConfiguration class and have trouble finding the source of truth for this field
There was a problem hiding this comment.
Great point @melvinsoft, I've missed that. I'll improve the task to be at least equal to the original behaviour, not worse.
There was a problem hiding this comment.
Thanks @johnbaldwin, I'll reply inline:
A. Does it make sense to add a tahoe/multisite env flag for this?
Maybe but I'm trying to avoid having such configuration to avoid having too much conflicts when we merge with Open edX.
B. Where is the source of 'course_org_filter'? I've looked over the SiteConfiguration class and have trouble finding the source of truth for this field
That would be found in the SiteConfiguration.values dictionary (example):
|
@OmarIthawi Thanks for putting this together, I just posted a question for you. |
By removing the `domain` part and using relative URLs instead
ba2b92e to
8e02399
Compare
|
@melvinsoft I think I've fixed the issue, please take a look. |
8e02399 to
1f1d8d5
Compare
By making the query only when needed
1f1d8d5 to
3952a04
Compare
I have checked it and the function doesn't seem to be used anywhere other than web requests.
I've fixed this and the query now runs one time at max, and only when needed. |
|
@OmarIthawi Thanks for the fix! |

This pull request does two changes:
retrieve_last_sitewide_block. By making theSELECT * FROM site_configuration_siteconfigurationquery only when needed.retrieve_last_sitewide_blocksite aware. By removing thedomainpart and using relative URLs instead i.e. starting with/.