From 3e63a8c243bc763ba51152526a4dd51ce442e09f Mon Sep 17 00:00:00 2001 From: shy Date: Mon, 8 Jul 2024 19:46:17 +0800 Subject: [PATCH] opt some --- base/web/product.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base/web/product.go b/base/web/product.go index 0a685eba..ee95011f 100644 --- a/base/web/product.go +++ b/base/web/product.go @@ -1,6 +1,8 @@ package web import ( + "strings" + ice "shylinux.com/x/icebergs" "shylinux.com/x/icebergs/base/ctx" "shylinux.com/x/icebergs/base/mdb" @@ -18,5 +20,8 @@ func init() { } func AddPortalProduct(m *ice.Message, name, text string, order float64, arg ...string) { - m.Cmd("web.product", mdb.CREATE, mdb.NAME, name, mdb.TEXT, text, mdb.ORDER, order, ctx.INDEX, m.PrefixKey(), ctx.ARGS, kit.Format(arg)) + msg := m.Spawn() + m.GoSleep("300ms", func() { + msg.Cmd("web.product", mdb.CREATE, mdb.NAME, name, mdb.TEXT, strings.TrimSpace(text), mdb.ORDER, order, ctx.INDEX, msg.PrefixKey(), ctx.ARGS, kit.Format(arg)) + }) }