duplex
04/14/2023, 1:06 PM[[env.production.services]]
binding = "workerA"
service = "worker-a"
[[env.production.services]]
binding = "workerB"
service = "worker-b"
Both services are called like that:
const workerAResponse = await env.workerA.fetch(
new Request(new URL(`worker-a/${id}`, env.WORKER_A_DOMAIN)),
{
headers: request.clone().headers,
}
);
if (!workerAResponse.ok) { return workerAResponse }
const { public_id } = await workerAResponse.json();
const workerBResponse = await env.workerB.fetch(
new Request(new URL(`worker-b/${public_id}`, env.WORKER_B_DOMAIN)),
{
headers: request.clone().headers,
}
);
if (!workerBResponse.ok) { return workerBResponse; }
Request to worker-a
is successful, however a request to` worker-b` is canceled, as wrangler tail
says:
GET <some-url> - Canceled @ 4/14/2023, 5:03:23 PM
What can possibly go wrong about it? And why worker-b response is canceled whereas worker-a (both are set up literally the same) works just fine. By the way, worker responds with 200
, but due to the outcome: "canceled"
it is not taken into account ;/kian
04/14/2023, 1:10 PMkian
04/14/2023, 1:10 PMkian
04/14/2023, 1:10 PMkian
04/14/2023, 1:11 PMduplex
04/14/2023, 1:11 PMkian
04/14/2023, 1:11 PMkian
04/14/2023, 1:12 PMduplex
04/14/2023, 1:12 PMduplex
04/14/2023, 1:13 PMkian
04/14/2023, 1:13 PMduplex
04/14/2023, 1:15 PMkian
04/14/2023, 1:17 PMworkers_dev = false
and remove any `route`/`routes` keys so that it's only possible to reach it over Service Bindings