mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
c204b3890c
@ -55,6 +55,7 @@ export const startMsgSSEStreamWithRetry: () => () => void = () => {
|
|||||||
responseType: 'stream',
|
responseType: 'stream',
|
||||||
adapter: 'fetch',
|
adapter: 'fetch',
|
||||||
});
|
});
|
||||||
|
if (!res?.data) return;
|
||||||
const stream = res.data;
|
const stream = res.data;
|
||||||
const reader = stream.pipeThrough(new TextDecoderStream()).getReader();
|
const reader = stream.pipeThrough(new TextDecoderStream()).getReader();
|
||||||
retryTimes = 0;
|
retryTimes = 0;
|
||||||
@ -74,7 +75,7 @@ export const startMsgSSEStreamWithRetry: () => () => void = () => {
|
|||||||
try {
|
try {
|
||||||
await createMsgSSEConnection(clientId);
|
await createMsgSSEConnection(clientId);
|
||||||
} catch (error) {
|
} 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;
|
const nextDelay = retryTimes < 6 ? 1000 * Math.pow(2, retryTimes) : 60000;
|
||||||
retryTimes++;
|
retryTimes++;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user