1
This commit is contained in:
parent
99637e8437
commit
fb3b8a273e
@ -2,6 +2,9 @@ package friend
|
||||
|
||||
import (
|
||||
"q5"
|
||||
"f5"
|
||||
"fmt"
|
||||
"main/constant"
|
||||
)
|
||||
|
||||
type friendMgr struct {
|
||||
@ -26,7 +29,34 @@ func (this *friendMgr) loadFromDB() {
|
||||
}
|
||||
|
||||
func (this *friendMgr) loadFriendships() {
|
||||
|
||||
var lastIdx int64
|
||||
f5.GetSysLog().Info("friendMgr.loadFriendships begin")
|
||||
var done = false
|
||||
for !done {
|
||||
f5.GetJsStyleDb().SyncSelectCustomQuery(
|
||||
constant.FRIEND_DB,
|
||||
fmt.Sprintf("SELECT * FROM t_friend_relationship WHERE idx > %d AND deleted = 0", lastIdx),
|
||||
func (err error, ds *f5.DataSet) {
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("friendMgr.loadFriendships dberror:%s", err))
|
||||
}
|
||||
for ds.Next() {
|
||||
idx := q5.ToInt64(ds.GetByName("idx"))
|
||||
if idx > lastIdx {
|
||||
lastIdx = idx
|
||||
} else {
|
||||
panic(fmt.Sprintf("friendMgr.loadFriendships idxerror:%s %s", idx, lastIdx))
|
||||
}
|
||||
}
|
||||
if ds.NumOfReaded() <= 0 {
|
||||
done = true
|
||||
}
|
||||
})
|
||||
}
|
||||
f5.GetSysLog().Info("friendMgr.loadFriendships end lastIdx:%s friendNum:%d blackNum:%d",
|
||||
lastIdx,
|
||||
len(this.friendHash),
|
||||
len(this.blackHash))
|
||||
}
|
||||
|
||||
func (this *friendMgr) loadBlacklist() {
|
||||
|
2
third_party/f5
vendored
2
third_party/f5
vendored
@ -1 +1 @@
|
||||
Subproject commit a149beea0673c64907f3d9e64153137aad52f790
|
||||
Subproject commit 35f839e5d4f3ef46a050c1968c16554ddb41c25e
|
Loading…
x
Reference in New Issue
Block a user