Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[projects] limit number of prebuilts #5319

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions components/gitpod-protocol/src/gitpod-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ export interface FindPrebuildsParams {
branch?: string;
latest?: boolean;
prebuildId?: string;
// default: 30
limit?: number;
}
export interface GetProviderRepositoriesParams {
provider: string;
Expand Down
5 changes: 4 additions & 1 deletion components/server/src/projects/projects-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ export class ProjectsService {
prebuilds.push(pbws);
}
} else {
const limit = params.latest ? 1 : undefined;
let limit = params.limit !== undefined ? params.limit : 30;
if (params.latest) {
limit = 1;
}
let branch = params.branch;
prebuilds = await this.workspaceDb.trace({}).findPrebuiltWorkspacesByProject(project.id, branch, limit);
}
Expand Down