fix(gateway): ignore stale lastTo for voice

This commit is contained in:
Peter Steinberger
2025-12-12 18:11:26 +00:00
parent 9ea697ac09
commit 8ca240fb2c
3 changed files with 100 additions and 6 deletions

View File

@@ -62,11 +62,9 @@ export async function saveSessionStore(
store: Record<string, SessionEntry>,
) {
await fs.promises.mkdir(path.dirname(storePath), { recursive: true });
await fs.promises.writeFile(
storePath,
JSON.stringify(store, null, 2),
"utf-8",
);
const tmp = `${storePath}.${process.pid}.${crypto.randomUUID()}.tmp`;
await fs.promises.writeFile(tmp, JSON.stringify(store, null, 2), "utf-8");
await fs.promises.rename(tmp, storePath);
}
export async function updateLastRoute(params: {