You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 lines
547 B

package delayer
import (
"texas-poker-bk/internal/logic/store"
"texas-poker-bk/tool/async"
"time"
)
// 清理离线用户
var (
OfflineCleanDelayer *async.DelayQueue[int64]
)
func init() {
OfflineCleanDelayer = async.NewDelayQueue(time.Second, 128, removeMemoryAccount)
}
// func removeMemoryAccount(account *session.NetAccount) {
func removeMemoryAccount(accountId int64, now time.Time) {
_ = store.NetAccounts.Get(accountId)
store.NetAccounts.Delete(accountId)
store.TokenVersions.Delete(accountId)
// TODO 持久化账户金额
}