@todoforai/figma-api 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/bridge.ts +5 -0
package/package.json
CHANGED
package/src/bridge.ts
CHANGED
|
@@ -34,6 +34,11 @@ function json(body: unknown, status = 200): Response {
|
|
|
34
34
|
export function startBridge(port: number): void {
|
|
35
35
|
Bun.serve({
|
|
36
36
|
port,
|
|
37
|
+
// Bun's default idleTimeout (10s) is shorter than our 25s /poll long-poll and
|
|
38
|
+
// 30s /cmd result-wait, so it would sever those connections mid-wait — making
|
|
39
|
+
// the plugin's fetch throw ("Relay unreachable") and commands silently time
|
|
40
|
+
// out. Hold connections long enough to cover both.
|
|
41
|
+
idleTimeout: 60,
|
|
37
42
|
async fetch(req) {
|
|
38
43
|
const url = new URL(req.url);
|
|
39
44
|
if (req.method === "OPTIONS") return json({}, 204);
|