fix(code): condition error
This commit is contained in:
parent
e9862571e2
commit
e228a71a57
12
collect.go
12
collect.go
|
@ -17,7 +17,7 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var ok bool
|
var ok bool
|
||||||
var lastLiveAnchor *CountLiveAnchors
|
|
||||||
for !ps.IsClose() {
|
for !ps.IsClose() {
|
||||||
|
|
||||||
liveanchor := &CountLiveAnchors{}
|
liveanchor := &CountLiveAnchors{}
|
||||||
|
@ -33,17 +33,8 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) {
|
||||||
}
|
}
|
||||||
cur, err = mdb.C.CountLiveAnchors.Find(context.TODO(), bson.M{"create_at": bson.M{"$gt": last}})
|
cur, err = mdb.C.CountLiveAnchors.Find(context.TODO(), bson.M{"create_at": bson.M{"$gt": last}})
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if lastLiveAnchor != nil {
|
|
||||||
if liveanchor.UID == liveanchor.UID {
|
|
||||||
ps.Wait(time.Second * 2)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
last = liveanchor.CreateAt
|
last = liveanchor.CreateAt
|
||||||
log.Println("last: ", last, liveanchor.UID)
|
log.Println("last: ", last, liveanchor.UID)
|
||||||
lastLiveAnchor = liveanchor
|
|
||||||
cur, err = mdb.C.CountLiveAnchors.Find(context.TODO(), bson.M{"create_at": bson.M{"$gt": last}})
|
cur, err = mdb.C.CountLiveAnchors.Find(context.TODO(), bson.M{"create_at": bson.M{"$gt": last}})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,6 +52,7 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
c := &CountLiveAnchors{}
|
c := &CountLiveAnchors{}
|
||||||
|
|
||||||
c.UID = la.ObjectID.Hex()
|
c.UID = la.ObjectID.Hex()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user