Commit 6ef9a17f authored by Chunchi Che's avatar Chunchi Che

Merge branch 'fix/ai' into 'main'

fix blocking in ai first

See merge request mycard/Neos!213
parents ec1837e9 d21d71cd
......@@ -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