fix(feishu): keep comment replay closed after generic failures

This commit is contained in:
Vincent Koc
2026-04-13 16:22:21 +01:00
parent 9c7cb6b67d
commit 6d38bd4768
4 changed files with 88 additions and 4 deletions

View File

@@ -5,11 +5,12 @@ export function createSequentialQueue() {
const previous = queues.get(key) ?? Promise.resolve();
const next = previous.then(task, task);
queues.set(key, next);
void next.finally(() => {
const cleanup = () => {
if (queues.get(key) === next) {
queues.delete(key);
}
});
};
next.then(cleanup, cleanup);
return next;
};
}