Skip to content

Commit

Permalink
fix: disable wait event loop in tencent serverless (#1029)
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 authored May 7, 2021
1 parent 61bc58d commit 89d5c2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages-serverless/serverless-scf-starter/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export class SCFRuntime extends ServerlessLightRuntime {
}
}

// 不再等待事件循环
// https://cloud.tencent.com/document/product/583/11060
context.callbackWaitsForEmptyEventLoop = false;
return {
isBase64Encoded: encoded,
statusCode: ctx.status,
Expand All @@ -106,6 +109,7 @@ export class SCFRuntime extends ServerlessLightRuntime {
})
.catch(err => {
ctx.logger.error(err);
context.callbackWaitsForEmptyEventLoop = false;
return {
isBase64Encoded: false,
statusCode: 500,
Expand Down

0 comments on commit 89d5c2e

Please sign in to comment.