fix: streamingテストおそい (#8912)
This commit is contained in:
parent
0076797b15
commit
034c5d792b
File diff suppressed because it is too large
Load diff
|
@ -186,7 +186,7 @@ export function connectStream(user: any, channel: string, listener: (message: Re
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export const waitFire = async (user: any, channel: string, trgr: () => any, cond: (msg: Record<string, any>) => boolean) => {
|
export const waitFire = async (user: any, channel: string, trgr: () => any, cond: (msg: Record<string, any>) => boolean, params?: any) => {
|
||||||
return new Promise<boolean>(async (res, rej) => {
|
return new Promise<boolean>(async (res, rej) => {
|
||||||
let timer: NodeJS.Timeout;
|
let timer: NodeJS.Timeout;
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ export const waitFire = async (user: any, channel: string, trgr: () => any, cond
|
||||||
if (timer) clearTimeout(timer);
|
if (timer) clearTimeout(timer);
|
||||||
res(true);
|
res(true);
|
||||||
}
|
}
|
||||||
});
|
}, params);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
rej(e);
|
rej(e);
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ export const waitFire = async (user: any, channel: string, trgr: () => any, cond
|
||||||
timer = setTimeout(() => {
|
timer = setTimeout(() => {
|
||||||
ws.close();
|
ws.close();
|
||||||
res(false);
|
res(false);
|
||||||
}, 5000);
|
}, 3000);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await trgr();
|
await trgr();
|
||||||
|
|
Loading…
Reference in a new issue