refactor: remove unused DISPATCHER interface and related code

This commit is contained in:
2026-06-11 00:25:26 -07:00
parent 35798508f3
commit c18350a0f0
4 changed files with 8 additions and 62 deletions

View File

@@ -2,12 +2,7 @@ export interface FetcherLike {
fetch(request: Request): Promise<Response>;
}
export interface DispatchNamespaceLike {
get(name: string, scriptArgs?: Record<string, unknown>, options?: Record<string, unknown>): FetcherLike;
}
export interface Env {
AUTH: FetcherLike;
DISPATCHER?: DispatchNamespaceLike;
DEFAULT_WORKER_NAME: string;
}

View File

@@ -18,21 +18,10 @@ app.all("*", async (c) => {
return c.env.AUTH.fetch(c.req.raw);
}
if (!c.env.DISPATCHER) {
return c.json({
ok: true,
routedTo: target.workerName,
});
}
const worker = c.env.DISPATCHER.get(target.workerName, {}, {
limits: {
cpuMs: 20,
subRequests: 20,
},
return c.json({
ok: true,
routedTo: target.workerName,
});
return worker.fetch(c.req.raw);
});
export default app;