Project

General

Profile

Actions

Task #3239

open

Catch all route for repo page or repo group page is always executing checks for every page

Added by Marcin Kuzminski [CTO] over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04.03.2016
Due date:
% Done:

0%

Estimated time:
Sorting:
Commit Number:

Description

THere's two routes in the match chain that catch repositories and groups landing page

   _connect_with_slash(
       rmap, 'repo_group_home', '/{group_name}',
       controller='home', action='index_repo_group',
       conditions={'function': check_group},
       requirements=URL_NAME_REQUIREMENTS)

and

   _connect_with_slash(
       rmap, 'summary_home', '/{repo_name}',
       controller='summary', action='index',
       conditions={'function': check_repo},
       requirements=URL_NAME_REQUIREMENTS)

There are defined at the beginning of the routes. Those routes execute check_repo and check_repo_group.
What it means that if you visit any other page inside a repo or group you have the check_repo or check_group executed twice.

Example:

You go to https://code.rhodecode.com/https://code.rhodecode.com/rhodecode-momentum/pull-request, currently it matches both checks, eg.

  • code checks if rhodecode-momentum/pull-request is a repository group (since /{group_name} match)
  • code checks if rhodecode-momentum/pull-request is a repository (since /{repo_name} match)
  • code checks if rhodecode-momentum is a repo (since /{repo_name}/pull-request}, only this matches since the route matches patterns, and repo check is valid.

Imho we should move the eager matching patterns at the end, so we reduce the group/repo checks to the very end. This should speed up most of the pages since those checks will be skipped

Actions #1

Updated by Marcin Kuzminski [CTO] over 8 years ago

  • Private changed from No to Yes
Actions #2

Updated by Marcin Kuzminski [CTO] over 8 years ago

  • Private changed from Yes to No
Actions #3

Updated by Marcin Kuzminski [CTO] over 8 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF