From 3fee88f2bfad62124ae27602f8e71506e49483e5 Mon Sep 17 00:00:00 2001 From: shy Date: Tue, 9 Apr 2024 18:25:08 +0800 Subject: [PATCH] add some --- base/web/space.go | 2 +- core/chat/script.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base/web/space.go b/base/web/space.go index 7d7ad2a6..44e16829 100644 --- a/base/web/space.go +++ b/base/web/space.go @@ -224,7 +224,7 @@ func _space_echo(m *ice.Message, source, target []string, c *websocket.Conn) { func _space_send(m *ice.Message, name string, arg ...string) (h string) { withecho := m.Option(ice.SPACE_NOECHO) != ice.TRUE kit.If(len(arg) > 0 && arg[0] == TOAST, func() { withecho = false; m.Option(ice.MSG_DEBUG, ice.FALSE) }) - wait, done := m.Wait(kit.Select("", m.OptionDefault(ice.SPACE_TIMEOUT, "180s"), withecho), func(msg *ice.Message, arg ...string) { + wait, done := m.Wait(kit.Select("", m.OptionDefault(ice.SPACE_TIMEOUT, "30s"), withecho), func(msg *ice.Message, arg ...string) { m.Cost(kit.Format("%v->[%v] %v %v", m.Optionv(ice.MSG_SOURCE), name, m.Detailv(), msg.FormatSize())).Copy(msg) }) if withecho { diff --git a/core/chat/script.js b/core/chat/script.js index 09224dbc..c59398b2 100644 --- a/core/chat/script.js +++ b/core/chat/script.js @@ -26,11 +26,11 @@ Volcanos(chat.ONACTION, { }, function(list) { can.Status(cli.STEP, list.length), can.Status(cli.COST, can.base.Duration(new Date().getTime()-begin)), can.user.toastSuccess(can) }) }, preview: function(event, can, msg, next, data, tr) { can.onappend.plugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX), style: msg.Option(ctx.STYLE)}, function(sub) { var done = false - function action(skip) { sub.Update(sub.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) { + function action(skip) { sub.Update(sub.request({}, {"space.timeout": "300s",_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) { sub.onimport._process(sub, msg) || msg.Length() == 0 && msg.Result() == "" || can.onappend._output(sub, msg), next && next(data) }) } if (msg.Option(ctx.STYLE) == "async") { - done = true, sub.Update(sub.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)]), next && next(data) + done = true, sub.Update(sub.request({}, {"space.timeout": "300s", _handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)]), next && next(data) } else { can.onmotion.delay(can, function() { if (done || sub._auto) { return } done = true, action() }, 300) }