This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

bobbin/worker: dont use startAndWaitForPorts, .fetch already does it

Signed-off-by: dawn <dawn@tangled.org>

author
dawn
date (Aug 1, 2026, 1:59 PM +0300) commit 5b5d78c4 parent 3f376f87 change-id sypyvswp
+14 -11
+14 -11
bobbin/worker/src/index.ts
··· 8 8 BOBBIN_LOG: string; 9 9 } 10 10 11 - export class BobbinContainer extends Container { 11 + export class BobbinContainer extends Container<Env> { 12 12 defaultPort = 8090; 13 13 enableInternet = true; 14 14 // Bobbin maintains an in-memory index rebuilt from Hydrant replay on every 15 15 // restart, so we want to avoid sleeping where possible. Override 16 16 // onActivityExpired() to keep the container alive indefinitely. 17 17 sleepAfter = "24h"; 18 + 19 + constructor(ctx: DurableObjectState<{}>, env: Env) { 20 + super(ctx, env, { 21 + envVars: { 22 + BOBBIN_HYDRANT_URL: env.BOBBIN_HYDRANT_URL, 23 + BOBBIN_SLINGSHOT_URL: env.BOBBIN_SLINGSHOT_URL, 24 + BOBBIN_LOG: env.BOBBIN_LOG, 25 + BOBBIN_LOG_FORMAT: "json", 26 + }, 27 + }); 28 + } 18 29 19 30 async onActivityExpired(): Promise<void> { 20 31 // Keep the container running; bobbin's in-memory index is expensive to ··· 88 99 ); 89 100 } 90 101 91 - const container = env.BOBBIN.getByName("primary"); 92 - await container.startAndWaitForPorts({ 93 - startOptions: { 94 - envVars: { 95 - BOBBIN_HYDRANT_URL: env.BOBBIN_HYDRANT_URL, 96 - BOBBIN_SLINGSHOT_URL: env.BOBBIN_SLINGSHOT_URL, 97 - BOBBIN_LOG: env.BOBBIN_LOG, 98 - BOBBIN_LOG_FORMAT: "json", 99 - }, 100 - }, 102 + const container = env.BOBBIN.getByName("primary-eu-v2", { 103 + locationHint: "weur", 101 104 }); 102 105 const response = await container.fetch(request); 103 106 // A 101 is a protocol switch (e.g. WebSocket upgrade); return it untouched