Skip to content

Commit

Permalink
[server] Don't fetch the repository config a second time when startin…
Browse files Browse the repository at this point in the history
…g incremental prebuilds
  • Loading branch information
jankeromnes committed Oct 18, 2022
1 parent e61ab5b commit 1a183fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ export class IncrementalPrebuildsService {
context: CommitContext,
history: WithCommitHistory,
user: User,
config?: WorkspaceConfig,
): Promise<PrebuiltWorkspace | undefined> {
if (!history.commitHistory || history.commitHistory.length < 1) {
return;
}

const { config } = await this.configProvider.fetchConfig({}, user, context);
if (!config) {
config = (await this.configProvider.fetchConfig({}, user, context)).config;
}
const imageSource = await this.imageSourceProvider.getImageSource({}, user, context, config);

// Note: This query returns only not-garbage-collected prebuilds in order to reduce cardinality
Expand Down
1 change: 1 addition & 0 deletions components/server/ee/src/workspace/workspace-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export class WorkspaceFactoryEE extends WorkspaceFactory {
commitContext,
context,
user,
config,
);
if (recentPrebuild) {
const loggedContext = filterForLogging(context);
Expand Down

0 comments on commit 1a183fc

Please sign in to comment.