From 10e32877c3f5a66af28492d21e77a1ad3baf2570 Mon Sep 17 00:00:00 2001 From: finxol Date: Wed, 1 Jul 2026 12:41:30 +0200 Subject: [PATCH] fix(workflows): use grpc proto http2 --- apps/workflows/src/cron/monitor.ts | 1 - apps/workflows/src/lib/native-fetch.ts | 6 ------ apps/workflows/src/serve.ts | 1 - 3 files changed, 8 deletions(-) delete mode 100644 apps/workflows/src/lib/native-fetch.ts diff --git a/apps/workflows/src/cron/monitor.ts b/apps/workflows/src/cron/monitor.ts index e3f86dac..a0d2935f 100644 --- a/apps/workflows/src/cron/monitor.ts +++ b/apps/workflows/src/cron/monitor.ts @@ -31,7 +31,6 @@ const redis = Redis.fromEnv(); const client = new CloudTasksClient({ projectId: env().GCP_PROJECT_ID, - fallback: "rest", credentials: { client_email: env().GCP_CLIENT_EMAIL, private_key: env().GCP_PRIVATE_KEY.replaceAll("\\n", "\n"), diff --git a/apps/workflows/src/lib/native-fetch.ts b/apps/workflows/src/lib/native-fetch.ts deleted file mode 100644 index e77c193f..00000000 --- a/apps/workflows/src/lib/native-fetch.ts +++ /dev/null @@ -1,6 +0,0 @@ -// google-gax (Cloud Tasks) routes through node-fetch unless `window.fetch` exists, -// and node-fetch on Deno's node:http shim costs ~5x the CPU of native fetch. -// Aliasing window to globalThis exposes window.fetch so google-gax picks native fetch. -// It must be globalThis (not a bare {fetch}) so @t3-oss/env's `"Deno" in window` -// server-detection still sees Deno and treats this as a server, not the browser. -(globalThis as { window?: unknown }).window ??= globalThis; diff --git a/apps/workflows/src/serve.ts b/apps/workflows/src/serve.ts index f6ee2a32..6f520562 100644 --- a/apps/workflows/src/serve.ts +++ b/apps/workflows/src/serve.ts @@ -1,6 +1,5 @@ /// -import "./lib/native-fetch"; import { getLogger } from "@logtape/logtape"; import { env } from "./env"; -- 2.51.2