mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
17 lines
433 B
TypeScript
17 lines
433 B
TypeScript
export const startSendInform = async () => {
|
|
if (global.sendInformQueue.length === 0 || global.sendInformQueueLen > 0) return;
|
|
global.sendInformQueueLen++;
|
|
|
|
try {
|
|
const fn = global.sendInformQueue[global.sendInformQueue.length - 1];
|
|
await fn();
|
|
global.sendInformQueue.pop();
|
|
global.sendInformQueueLen--;
|
|
|
|
startSendInform();
|
|
} catch (error) {
|
|
global.sendInformQueueLen--;
|
|
startSendInform();
|
|
}
|
|
};
|