公共模块优化
This commit is contained in:
parent
cd5203b8f6
commit
9f1187962e
@ -42,7 +42,7 @@ func (s *ServerMod) init() {
|
|||||||
s.update = false
|
s.update = false
|
||||||
s.LoadData()
|
s.LoadData()
|
||||||
s.mDispatr.AfterFunc(time.Duration(PER_SAVE_TIME)*time.Second, func() {
|
s.mDispatr.AfterFunc(time.Duration(PER_SAVE_TIME)*time.Second, func() {
|
||||||
s.SaveData()
|
go s.SaveData()
|
||||||
})
|
})
|
||||||
go func() {
|
go func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
@ -128,7 +128,7 @@ func (s *ServerMod) Call(m *msg.Msg) (interface{}, error) {
|
|||||||
// mysql 保存消息
|
// mysql 保存消息
|
||||||
func (s *ServerMod) SaveData() {
|
func (s *ServerMod) SaveData() {
|
||||||
s.mDispatr.AfterFunc(time.Duration(PER_SAVE_TIME+GoUtil.RandNum(5, 10))*time.Second, func() {
|
s.mDispatr.AfterFunc(time.Duration(PER_SAVE_TIME+GoUtil.RandNum(5, 10))*time.Second, func() {
|
||||||
s.SaveData()
|
go s.SaveData()
|
||||||
})
|
})
|
||||||
DbData := db.SqlServerModStruct{}
|
DbData := db.SqlServerModStruct{}
|
||||||
DbData.Key = s.key
|
DbData.Key = s.key
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user