From 735049a918eab807d2e9c47cde5466d0946b7247 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sat, 6 Sep 2025 11:22:23 -0700 Subject: [PATCH] dont die early --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 34acf48..37ec9d7 100644 --- a/index.js +++ b/index.js @@ -106,7 +106,7 @@ export class MyDurableObject { saveSnapshot() { this.lastSavedAt = Date.now(); - this.state.storage.put('run', { rid: this.rid, buffer: this.buffer, seq: this.seq, age: this.age, phase: this.phase, error: this.error, savedAt: this.lastSavedAt }).catch(() => {}); + return this.state.storage.put('run', { rid: this.rid, buffer: this.buffer, seq: this.seq, age: this.age, phase: this.phase, error: this.error, savedAt: this.lastSavedAt }).catch(() => {}); } replay(ws, after) { @@ -174,7 +174,7 @@ export class MyDurableObject { this.rid = rid; this.phase = 'running'; this.controller = new AbortController(); - this.saveSnapshot(); + await this.saveSnapshot(); this.state.waitUntil(this.startHeartbeat()); this.state.waitUntil(this.stream({ apiKey, body, provider: provider || 'openrouter' }));