save
This commit is contained in:
parent
74d6888f96
commit
1e49bc8869
@ -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
|
||||
}
|
||||
|
||||
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user