improve performance of [GithubLastCommit] [GitlabLastCommit] [GiteaLastCommit] (#10046)
* improve performance of last commit badges * pass param in the right place
This commit is contained in:
@@ -126,7 +126,7 @@ export default class GiteaLastCommit extends GiteaBase {
|
||||
return super.fetch({
|
||||
schema,
|
||||
url: `${baseUrl}/api/v1/repos/${user}/${repo}/commits`,
|
||||
options: { searchParams: { sha: branch, path } },
|
||||
options: { searchParams: { sha: branch, path, limit: 1 } },
|
||||
httpErrors: httpErrorsFor(),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ export default class GithubLastCommit extends GithubAuthV3Service {
|
||||
async fetch({ user, repo, branch, path }) {
|
||||
return this._requestJson({
|
||||
url: `/repos/${user}/${repo}/commits`,
|
||||
options: { searchParams: { sha: branch, path } },
|
||||
options: { searchParams: { sha: branch, path, per_page: 1 } },
|
||||
schema,
|
||||
httpErrors: httpErrorsFor(),
|
||||
})
|
||||
|
||||
@@ -79,7 +79,7 @@ export default class GitlabLastCommit extends GitLabBase {
|
||||
url: `${baseUrl}/api/v4/projects/${encodeURIComponent(
|
||||
project,
|
||||
)}/repository/commits`,
|
||||
options: { searchParams: { ref_name: ref, path } },
|
||||
options: { searchParams: { ref_name: ref, path, per_page: 1 } },
|
||||
schema,
|
||||
httpErrors: httpErrorsFor('project not found'),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user