Skip to content

Commit 1a183fc

Browse files
committed
[server] Don't fetch the repository config a second time when starting incremental prebuilds
1 parent e61ab5b commit 1a183fc

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

components/server/ee/src/prebuilds/incremental-prebuilds-service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,15 @@ export class IncrementalPrebuildsService {
6868
context: CommitContext,
6969
history: WithCommitHistory,
7070
user: User,
71+
config?: WorkspaceConfig,
7172
): Promise<PrebuiltWorkspace | undefined> {
7273
if (!history.commitHistory || history.commitHistory.length < 1) {
7374
return;
7475
}
7576

76-
const { config } = await this.configProvider.fetchConfig({}, user, context);
77+
if (!config) {
78+
config = (await this.configProvider.fetchConfig({}, user, context)).config;
79+
}
7780
const imageSource = await this.imageSourceProvider.getImageSource({}, user, context, config);
7881

7982
// Note: This query returns only not-garbage-collected prebuilds in order to reduce cardinality

components/server/ee/src/workspace/workspace-factory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class WorkspaceFactoryEE extends WorkspaceFactory {
123123
commitContext,
124124
context,
125125
user,
126+
config,
126127
);
127128
if (recentPrebuild) {
128129
const loggedContext = filterForLogging(context);

0 commit comments

Comments
 (0)