Skip to content

Commit 8eb2629

Browse files
c-c-eprCopilot
andcommitted
chore: 移動日誌記錄至非同步執行區域以改善性能
Co-authored-by: Copilot <copilot@github.com>
1 parent ca2589d commit 8eb2629

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ export async function router(request: Request, env: Env, ctx: ExecutionContext)
4242
if (signature !== `sha256=${expectedSignature}`) {
4343
return new Response("Invalid signature", { status: 401 });
4444
}
45-
console.log(request.headers.get("X-ZSend-Event"));
4645

4746
// 非同步執行
4847
ctx.waitUntil(
4948
(async () => {
5049
// 在這裡可以做一些背景工作
5150
// You can do some work in the background here
51+
console.log(`[${request.headers.get("X-ZSend-Event")?.toUpperCase() ?? "UNKNOWN"}]`, body);
5252
})(),
5353
);
5454
// 回傳成功

0 commit comments

Comments
 (0)