Skip to content

Commit 4cea507

Browse files
fix: Handling build cache
1 parent 399cea3 commit 4cea507

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/frameworks/cdkFramework.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ export class CdkFramework implements IFramework {
306306
"aws:cdk:bundling-stacks": [],
307307
};
308308
process.env.CDK_CONTEXT_JSON = JSON.stringify(CDK_CONTEXT_JSON);
309-
Logger.verbose(`[CDK] context:`, JSON.stringify(CDK_CONTEXT_JSON, null, 2));
309+
Logger.verbose(`[CDK] Context:`, JSON.stringify(CDK_CONTEXT_JSON, null, 2));
310310

311311
const lambdas: any[] = await new Promise((resolve, reject) => {
312312
const worker = new Worker(
@@ -460,7 +460,7 @@ export class CdkFramework implements IFramework {
460460
}
461461

462462
entryFile = path.resolve(entryFile);
463-
Logger.verbose(`[CDK] entry file: ${entryFile}`);
463+
Logger.verbose(`[CDK] Entry file: ${entryFile}`);
464464

465465
return entryFile;
466466
}

src/lambdaConnection.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function onMessageFromLambda(message: IoTMessage) {
6969

7070
if (Configuration.config.verbose) {
7171
Logger.verbose(
72-
`[Function ${message.data.functionId}] response: `,
72+
`[Function ${message.data.functionId}] Response: `,
7373
JSON.stringify(message.data, null, 2)
7474
);
7575
} else {
@@ -78,15 +78,15 @@ async function onMessageFromLambda(message: IoTMessage) {
7878
? JSON.stringify(message.data).substring(0, 100)
7979
: "";
8080
Logger.log(
81-
`[Function ${message.data.functionId}] request: ${requestPretty}${requestPretty.length < 50 ? "" : "..."}`
81+
`[Function ${message.data.functionId}] Request: ${requestPretty}${requestPretty.length < 50 ? "" : "..."}`
8282
);
8383
}
8484

8585
const response = await NodeHandler.invokeLambda(message.data);
8686

8787
if (Configuration.config.verbose) {
8888
Logger.verbose(
89-
`[Function ${message.data.functionId}] response: `,
89+
`[Function ${message.data.functionId}] Response: `,
9090
JSON.stringify(response, null, 2)
9191
);
9292
} else {
@@ -95,7 +95,7 @@ async function onMessageFromLambda(message: IoTMessage) {
9595
? JSON.stringify(response).substring(0, 100)
9696
: "";
9797
Logger.log(
98-
`[Function ${message.data.functionId}] response: ${responsePretty}${responsePretty.length < 50 ? "" : "..."}`
98+
`[Function ${message.data.functionId}] Response: ${responsePretty}${responsePretty.length < 50 ? "" : "..."}`
9999
);
100100
}
101101

@@ -121,7 +121,7 @@ async function onMessageFromLambda(message: IoTMessage) {
121121
);
122122
}
123123
} catch (e: any) {
124-
Logger.error(`${message.data.functionId} error: `, e.errorMessage);
124+
Logger.error(`[Function ${message.data.functionId}] Error: `, e);
125125

126126
const payload: IoTMessage = {
127127
type: "ERROR",

src/nodeEsBuild.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ async function getBuild(functionId: string) {
6363
ctx: newBuildAssets.then((b) => b.ctx),
6464
current: true,
6565
};
66+
buildCache[functionId] = buildAssets;
6667
}
6768

6869
const result = await buildAssets.result;

0 commit comments

Comments
 (0)