Merge branch 'main' into next

This commit is contained in:
nocobase[bot] 2025-02-12 12:05:21 +00:00
commit c204b3890c

View File

@ -55,6 +55,7 @@ export const startMsgSSEStreamWithRetry: () => () => void = () => {
responseType: 'stream',
adapter: 'fetch',
});
if (!res?.data) return;
const stream = res.data;
const reader = stream.pipeThrough(new TextDecoderStream()).getReader();
retryTimes = 0;
@ -74,7 +75,7 @@ export const startMsgSSEStreamWithRetry: () => () => void = () => {
try {
await createMsgSSEConnection(clientId);
} catch (error) {
console.error('Error during stream:', error.message);
console.log(`sse connection for clientId ${clientId} failed, retrying...`, error);
const nextDelay = retryTimes < 6 ? 1000 * Math.pow(2, retryTimes) : 60000;
retryTimes++;
setTimeout(() => {