Skip to content

Commit ab3e6e4

Browse files
committed
fix(serverless): wrapEventFunction does not await for async
1 parent 8161005 commit ab3e6e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/serverless/src/gcpfunction/events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function _wrapEventFunction(
2929
flushTimeout: 2000,
3030
...wrapOptions,
3131
};
32-
return (data, context, callback) => {
32+
return async (data, context, callback) => {
3333
const transaction = startTransaction({
3434
name: context.eventType,
3535
op: 'gcp.function.event',
@@ -67,7 +67,7 @@ function _wrapEventFunction(
6767
return (fn as EventFunctionWithCallback)(data, context, newCallback);
6868
}
6969

70-
void Promise.resolve()
70+
await Promise.resolve()
7171
.then(() => (fn as EventFunction)(data, context))
7272
.then(
7373
result => {

0 commit comments

Comments
 (0)