From e1a312beebf2dd13333e0c81c5fce60f52a5176f Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 30 Jan 2023 18:01:41 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BF=83=E8=B7=B3=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=96=AD=E7=BA=BF=E6=97=B6=E9=97=B4=E6=88=B3=E4=B8=BA=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E5=81=8F=E7=A7=BB=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agent.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index cfe43f439..1001b28f1 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -88,7 +88,8 @@ locp: SubType: "heartbeat", Data: data, }) - //this.wsConn.SetReadDeadline(time.Now().Add(time.Second * 30)) + + //this.wsConn.SetReadDeadline(configure.Now().Add(time.Second * 30)) continue } if err := this.messageDistribution(msg); err != nil { From 9077626a90356e0fd47bb3cea52118aa0afd311c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 30 Jan 2023 18:11:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pagoda/model_rank.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/pagoda/model_rank.go b/modules/pagoda/model_rank.go index d05160f54..55a66a5d3 100644 --- a/modules/pagoda/model_rank.go +++ b/modules/pagoda/model_rank.go @@ -16,6 +16,8 @@ import ( "github.com/go-redis/redis/v8" "go.mongodb.org/mongo-driver/bson/primitive" + "go.mongodb.org/mongo-driver/mongo" + "go.mongodb.org/mongo-driver/x/bsonx" ) var floorRankKey = "pagoda:floor" @@ -29,6 +31,11 @@ func (this *ModelRank) Init(service core.IService, module core.IModule, comp cor this.TableName = comm.TablePagodaRecord err = this.MCompModel.Init(service, module, comp, options) this.modulePagoda = module.(*Pagoda) + + //创建uid索引 + this.DB.CreateIndex(core.SqlTable(comm.TableMail), mongo.IndexModel{ + Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, + }) return }