This commit is contained in:
aozhiwei 2024-04-13 17:39:38 +08:00
parent bc986a954f
commit 5527657f31

View File

@ -1,8 +1,12 @@
package mail
import (
"q5"
"f5"
"main/common"
"main/constant"
"sync"
"fmt"
"github.com/gin-gonic/gin"
)
@ -25,13 +29,26 @@ type mailMgr struct {
func (this *mailMgr) Init() {
this.idHash = make(map[int64]*mail)
this.loadFromDB()
this.loadMails()
}
func (this *mailMgr) UnInit() {
}
func (this *mailMgr) loadFromDB() {
func (this *mailMgr) loadMails() {
f5.GetSysLog().Info("mailMgr.loadMails begin")
nowTime := f5.GetApp().GetNowSeconds()
lastIdx := f5.GetJsStyleDb().SyncBatchLoadFullTable(
constant.MAIL_DB,
"SELECT * FROM t_mail WHERE idx > %d AND deleted = 0 AND expiretime > " + q5.ToString(nowTime),
func (ds *f5.DataSet) {
},
func (err error) {
panic(fmt.Sprintf("mailMgr.loadMails dberror:%s", err))
})
f5.GetSysLog().Info("mailMgr.loadMails end lastIdx:%d mailNum:%d",
lastIdx,
len(this.idHash))
}
func (this *mailMgr) caGetMailList(hum common.Player, c *gin.Context) {