[obs-commits] [openSUSE/open-build-service] a7fb91: Cache user_can_modify_project in repository page
Branch: refs/heads/master Home: https://github.com/openSUSE/open-build-service Commit: a7fb91615ef30c2a78bd1036c2a6110fd1ca0d81 https://github.com/openSUSE/open-build-service/commit/a7fb91615ef30c2a78bd10... Author: Stephan Kulow <coolo@suse.de> Date: 2018-12-19 (Wed, 19 Dec 2018) Changed paths: M src/api/app/views/webui2/webui/repositories/_repository_card_content.html.haml M src/api/app/views/webui2/webui/repositories/_repository_entry.html.haml M src/api/app/views/webui2/webui/repositories/index.html.haml Log Message: ----------- Cache user_can_modify_project in repository page This function was called *twice* per repository and is not exactly cheap: CACHE Flag Exists (0.0ms) SELECT 1 AS one FROM `flags` WHERE `flags`.`project_id` = 2 AND `flags`.`flag` = 'lock' AND `flags`.`status` = 'enable' LIMIT 1 has_global_permission? change_project CACHE (0.0ms) SELECT `roles_static_permissions`.`role_id` FROM `roles_static_permissions` INNER JOIN `static_permissions` ON `static_permissions`.`id` = `roles_static_permissions`.`s tatic_permission_id` WHERE `static_permissions`.`title` = 'change_project' running local permission check: user coolo, project home:Admin, permission 'change_project' CACHE Project Load (0.0ms) SELECT `projects`.* FROM `projects` WHERE (projects.id not in (0)) AND `projects`.`name` = 'home' ORDER BY `projects`.`name` DESC LIMIT 1 CACHE Relationship Exists (0.0ms) SELECT 1 AS one FROM `relationships` WHERE `relationships`.`project_id` = 2 AND `relationships`.`user_id` = 3 AND (role_id in (1,2)) LIMIT 1 CACHE Relationship Exists (0.0ms) SELECT 1 AS one FROM `relationships` INNER JOIN `groups` ON `groups`.`id` = `relationships`.`group_id` INNER JOIN `groups_users` ON `groups_users`.` group_id` = `groups`.`id` WHERE `relationships`.`project_id` = 2 AND `groups_users`.`user_id` = 3 AND (role_id in (1,2)) LIMIT 1 Commit: 6497d9510d8cce341665c309afd8e0c5f2d60941 https://github.com/openSUSE/open-build-service/commit/6497d9510d8cce341665c3... Author: Stephan Kulow <stephan@kulow.org> Date: 2018-12-19 (Wed, 19 Dec 2018) Changed paths: M src/api/app/views/webui2/webui/repositories/_repository_card_content.html.haml M src/api/app/views/webui2/webui/repositories/_repository_entry.html.haml M src/api/app/views/webui2/webui/repositories/index.html.haml Log Message: ----------- Merge pull request #6664 from coolo/avoid_sql Cache user_can_modify_project in repository page Compare: https://github.com/openSUSE/open-build-service/compare/dd0d5460e941...6497d9... **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
participants (1)
-
Stephan Kulow