Commit d21d71cd authored by Chunchi Che's avatar Chunchi Che

fix blocking in ai first

parent ec1837e9
Pipeline #22120 passed with stages
in 15 minutes and 45 seconds
......@@ -11,7 +11,7 @@
"cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"chainALL": false,
"streamInterval": 200,
"streamInterval": 20,
"ui":{
"hint":{
"waitingDuration":1.5,
......
......@@ -11,7 +11,7 @@
"cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"chainALL": false,
"streamInterval": 200,
"streamInterval": 20,
"ui":{
"hint":{
"waitingDuration":1.5,
......
......@@ -53,14 +53,14 @@ export class WebSocketStream {
return;
} else {
// websocket not closed, wait some time, and then handle next message from server
await sleep(useConfig().streamInterval);
// websocket not closed, handle next message from server
await reader.read().then(process);
}
}
if (value) {
// wait some time, and then handle message from server
await sleep(useConfig().streamInterval);
await onMessage(value);
} else {
console.warn("value from ReadableStream is undefined!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment