diff --git a/.changeset/hardcode-cohort-ent.md b/.changeset/hardcode-cohort-ent.md new file mode 100644 index 0000000000..058f33c585 --- /dev/null +++ b/.changeset/hardcode-cohort-ent.md @@ -0,0 +1,7 @@ +--- +"@cloudflare/workers-shared": patch +--- + +Temporarily hardcode asset worker cohort to "ent" for latency testing + +Disables the `lookupCohort` RPC call and cohort-based version routing in the outer entrypoint while keeping all the glue code (analytics, bindings, types) in place for re-enablement. diff --git a/packages/workers-shared/asset-worker/src/worker.ts b/packages/workers-shared/asset-worker/src/worker.ts index 76818026b6..4e4358b83b 100644 --- a/packages/workers-shared/asset-worker/src/worker.ts +++ b/packages/workers-shared/asset-worker/src/worker.ts @@ -372,10 +372,12 @@ export default class AssetWorkerOuter */ private async getCohort(): Promise { if (this.resolvedCohort === undefined) { - this.resolvedCohort = await lookupCohort( - this.env, - this.env.CONFIG?.account_id - ); + // TODO: Hardcoding temporarily for latency testing. + // this.resolvedCohort = await lookupCohort( + // this.env, + // this.env.CONFIG?.account_id + // ); + this.resolvedCohort = "ent"; } return this.resolvedCohort; } @@ -385,7 +387,7 @@ export default class AssetWorkerOuter * When a cohort is provided, the runtime routes the inner entrypoint * to the version assigned to that cohort in the current deployment. */ - private getInnerEntrypoint(cohort?: string | null): AssetWorkerMethods { + private getInnerEntrypoint(_cohort?: string | null): AssetWorkerMethods { const loopbackCtx = this.ctx as AssetWorkerContext; const entrypoint = loopbackCtx.exports?.AssetWorkerInner; if (entrypoint === undefined) { @@ -397,7 +399,8 @@ export default class AssetWorkerOuter } return entrypoint({ props: { traceContext: this.env.JAEGER.getSpanContext() }, - ...(cohort ? { version: { cohort } } : {}), + // TODO: Hardcoding temporarily for latency testing. + // ...(cohort ? { version: { cohort } } : {}), }); }