Skip to content

Commit

Permalink
[projects] limit number of prebuilts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev authored and roboquat committed Aug 24, 2021
1 parent 4d96c95 commit cf55a21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit cf55a21

Please sign in to comment.