Skip to content

Commit

Permalink
fix(framework): dont throw when profiler package couldn't be built.
Browse files Browse the repository at this point in the history
fix also integration tests by disabling profiler
  • Loading branch information
marcj committed Oct 30, 2023
1 parent 455f243 commit 3b165d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/framework-integration/tests/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export async function createServerClientPair(
AppModule.configure({
framework: {
server: server,
debugProfiler: false,
broker: { listen: exchangeSocketPath },
}
})
Expand Down
9 changes: 6 additions & 3 deletions packages/framework/src/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ export class RpcServerActionWithStopwatch extends RpcServerAction {
const body = message.parseBody<rpcActionType>();
const frame = this.stopwatch ? this.stopwatch.start(body.method + '() [' + body.controller + ']', FrameCategory.rpc, true) : undefined;
if (frame) {
const types = await this.loadTypes(body.controller, body.method);
const value: { args: any[] } = message.parseBody(types.actionCallSchema);
frame.data({ method: body.method, controller: body.controller, arguments: value.args });
try {
const types = await this.loadTypes(body.controller, body.method);
const value: { args: any[] } = message.parseBody(types.actionCallSchema);
frame.data({ method: body.method, controller: body.controller, arguments: value.args });
} catch {
}
}

try {
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/tests/stopwatch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ test('encode/decode', async () => {
console.log('data', data);
const http = deserializeFrameData(data) as FrameCategoryData[FrameCategory.http];
console.log('http', http);
expect(http).toEqual({ method: 'GET', clientIp: '127.0.0.01' });
expect(http).toEqual({ method: 'GET', clientIp: '127.0.0.1' });
});
});

0 comments on commit 3b165d6

Please sign in to comment.