From 6b21919a3d8042afa0270c825bc119e9b58c0455 Mon Sep 17 00:00:00 2001 From: Daniel Walsh Date: Mon, 2 Dec 2024 16:12:28 +0000 Subject: [PATCH] Remove await from user Worker fetch in router-worker (#7410) --- .changeset/gorgeous-paws-compare.md | 5 +++++ packages/workers-shared/router-worker/src/index.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/gorgeous-paws-compare.md diff --git a/.changeset/gorgeous-paws-compare.md b/.changeset/gorgeous-paws-compare.md new file mode 100644 index 000000000000..9bf269632e1d --- /dev/null +++ b/.changeset/gorgeous-paws-compare.md @@ -0,0 +1,5 @@ +--- +"@cloudflare/workers-shared": patch +--- + +chore: remove awaits from Asset Worker fetches. This has no user-facing impact. diff --git a/packages/workers-shared/router-worker/src/index.ts b/packages/workers-shared/router-worker/src/index.ts index ccb412adbb0a..59d4d4d6a1a7 100644 --- a/packages/workers-shared/router-worker/src/index.ts +++ b/packages/workers-shared/router-worker/src/index.ts @@ -72,7 +72,7 @@ export default { if (env.CONFIG.has_user_worker) { if (await env.ASSET_WORKER.unstable_canFetch(request)) { analytics.setData({ dispatchtype: DISPATCH_TYPE.ASSETS }); - return await env.ASSET_WORKER.fetch(maybeSecondRequest); + return env.ASSET_WORKER.fetch(maybeSecondRequest); } else { analytics.setData({ dispatchtype: DISPATCH_TYPE.WORKER }); return env.USER_WORKER.fetch(maybeSecondRequest); @@ -80,7 +80,7 @@ export default { } analytics.setData({ dispatchtype: DISPATCH_TYPE.ASSETS }); - return await env.ASSET_WORKER.fetch(request); + return env.ASSET_WORKER.fetch(request); } catch (err) { if (err instanceof Error) { analytics.setData({ error: err.message });