Files
openclaw/extensions/feishu/src/sequential-queue.ts
Nimrod Gutman 4b4ec4dbc2 fix(feishu): route /btw through out-of-band lanes (#64324)
* fix(feishu): route /btw through out-of-band lanes

* fix(feishu): bound btw out-of-band lanes

* fix: route feishu btw out-of-band (#64324) (thanks @ngutman)
2026-04-10 17:48:15 +03:00

16 lines
430 B
TypeScript

export function createSequentialQueue() {
const queues = new Map<string, Promise<void>>();
return (key: string, task: () => Promise<void>): Promise<void> => {
const previous = queues.get(key) ?? Promise.resolve();
const next = previous.then(task, task);
queues.set(key, next);
void next.finally(() => {
if (queues.get(key) === next) {
queues.delete(key);
}
});
return next;
};
}