mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 03:40:43 +00:00
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)
This commit is contained in:
15
extensions/feishu/src/sequential-queue.ts
Normal file
15
extensions/feishu/src/sequential-queue.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user