This commit is contained in:
殷勇 2023-10-27 17:58:31 +08:00
parent 74d6888f96
commit 1e49bc8869
3 changed files with 10 additions and 2 deletions

View File

@ -85,7 +85,7 @@ func (m *Mail) IsReadableMail(accountObj common.Player) bool {
}
}
nowUnixSec := int32(time.Now().Unix())
if m.ExpireTime > nowUnixSec && m.SendTime <= nowUnixSec && accountObj.IsUnreadMail(m.MailId) && !accountObj.IsDeletedMail(m.MailId) {
if m.ExpireTime > nowUnixSec && m.SendTime <= nowUnixSec && !accountObj.IsDeletedMail(m.MailId) {
return true
}

View File

@ -224,6 +224,7 @@ func (p *Player) SaveToDB() {
}
func (p *Player) MarkDirty() {
// f5.GetApp().RegisterMainThreadCb(func() {})
timer := f5.GetTimer()
timer.SetTimeout(
1000*10,
@ -240,6 +241,6 @@ func NewPlayer(accountId string) *Player {
AccountId: accountId,
ReadMailHash: make(map[int64]*ReadMail),
DeletedMailHash: make(map[int64]*DeletedMail),
CacheExpiration: time.Now().Add(10 * time.Second),
CacheExpiration: time.Now().Add(20 * time.Second),
}
}

View File

@ -4,6 +4,7 @@ import (
"f5"
"github.com/gin-gonic/gin"
"main/middleware"
"net/http"
)
type routerMgr struct {
@ -12,6 +13,12 @@ type routerMgr struct {
func (rm *routerMgr) Init() {
router := f5.GetApp().GetGinEngine()
router.NoRoute(func(c *gin.Context) {
c.JSON(http.StatusNotFound, gin.H{
"errcode": http.StatusNotFound,
"errmsg": "Not Found",
})
})
router.Use(gin.Logger())
authRouterGroup := router.Group("api")