mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
redis ttl
This commit is contained in:
parent
aad27f40cf
commit
b751156b5c
@ -41,7 +41,7 @@ func (d *DataBases) JudgeAccountEXISTS(account string) (bool, error) {
|
|||||||
}
|
}
|
||||||
func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error) {
|
func (d *DataBases) SetAccountCode(account string, code, ttl int) (err error) {
|
||||||
key := AccountTempCode + account
|
key := AccountTempCode + account
|
||||||
_, err = d.Exec("SET", key, code)
|
_, err = d.Exec("SET", key, code, "ex", ttl)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
func (d *DataBases) GetAccountCode(account string) (string, error) {
|
func (d *DataBases) GetAccountCode(account string) (string, error) {
|
||||||
@ -49,7 +49,6 @@ func (d *DataBases) GetAccountCode(account string) (string, error) {
|
|||||||
return redis.String(d.Exec("GET", key))
|
return redis.String(d.Exec("GET", key))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Perform seq auto-increment operation of user messages
|
//Perform seq auto-increment operation of user messages
|
||||||
func (d *DataBases) IncrUserSeq(uid string) (uint64, error) {
|
func (d *DataBases) IncrUserSeq(uid string) (uint64, error) {
|
||||||
key := userIncrSeq + uid
|
key := userIncrSeq + uid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user