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
Pipeline #22121 passed with stages
in 14 minutes and 2 seconds
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb", "cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf", "stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"chainALL": false, "chainALL": false,
"streamInterval": 200, "streamInterval": 20,
"ui":{ "ui":{
"hint":{ "hint":{
"waitingDuration":1.5, "waitingDuration":1.5,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb", "cardsDbUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/cards.cdb",
"stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf", "stringsUrl":"https://cdn02.moecube.com:444/ygopro-database/zh-CN/strings.conf",
"chainALL": false, "chainALL": false,
"streamInterval": 200, "streamInterval": 20,
"ui":{ "ui":{
"hint":{ "hint":{
"waitingDuration":1.5, "waitingDuration":1.5,
......
...@@ -53,14 +53,14 @@ export class WebSocketStream { ...@@ -53,14 +53,14 @@ export class WebSocketStream {
return; return;
} else { } else {
// websocket not closed, wait some time, and then handle next message from server // websocket not closed, handle next message from server
await sleep(useConfig().streamInterval);
await reader.read().then(process); await reader.read().then(process);
} }
} }
if (value) { if (value) {
// wait some time, and then handle message from server
await sleep(useConfig().streamInterval);
await onMessage(value); await onMessage(value);
} else { } else {
console.warn("value from ReadableStream is undefined!"); 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