Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/hardcode-cohort-ent.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 9 additions & 6 deletions packages/workers-shared/asset-worker/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,12 @@ export default class AssetWorkerOuter<TEnv extends Env = Env>
*/
private async getCohort(): Promise<string | null> {
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";
Comment thread
courtney-sims marked this conversation as resolved.
}
return this.resolvedCohort;
}
Expand All @@ -385,7 +387,7 @@ export default class AssetWorkerOuter<TEnv extends Env = Env>
* 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) {
Expand All @@ -397,7 +399,8 @@ export default class AssetWorkerOuter<TEnv extends Env = Env>
}
return entrypoint({
props: { traceContext: this.env.JAEGER.getSpanContext() },
...(cohort ? { version: { cohort } } : {}),
// TODO: Hardcoding temporarily for latency testing.
// ...(cohort ? { version: { cohort } } : {}),
});
}

Expand Down
Loading