Skip to content

Commit 8099576

Browse files
committed
assign repo home page default priority
1 parent aec549d commit 8099576

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

routers/common/qos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func requestPriority(ctx context.Context) Priority {
104104

105105
// If we're operating in the context of a repo, assign low priority
106106
routePattern := rctx.RoutePattern()
107-
if strings.HasPrefix(routePattern, "/{username}/{reponame}") {
107+
if strings.HasPrefix(routePattern, "/{username}/{reponame}/") {
108108
return LowPriority
109109
}
110110

routers/common/qos_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ func TestRequestPriority(t *testing.T) {
3333
RoutePattern: "/user/login",
3434
Expected: DefaultPriority,
3535
},
36+
{
37+
Name: "Repo Home",
38+
RoutePattern: "/{username}/{reponame}",
39+
Expected: DefaultPriority,
40+
},
3641
{
3742
Name: "User Repo",
3843
RoutePattern: "/{username}/{reponame}/src/branch/main",

0 commit comments

Comments
 (0)