feat(uid): uid use object id
This commit is contained in:
parent
487ce31c4c
commit
daaf0e420e
|
@ -7,7 +7,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.nonolive.co/eson.hsm/databoard-collect/database"
|
"git.nonolive.co/eson.hsm/databoard-collect/database"
|
||||||
"github.com/google/uuid"
|
|
||||||
"go.mongodb.org/mongo-driver/bson"
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
)
|
)
|
||||||
|
@ -45,14 +44,15 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for cur.Next(context.TODO()) {
|
for cur.Next(context.TODO()) {
|
||||||
la := &database.LiveAnchorsCountPoint{}
|
// la := &database.LiveAnchorsCountPoint{}
|
||||||
|
la := &database.LiveAnchorsCountPointObjectID{}
|
||||||
err = cur.Decode(la)
|
err = cur.Decode(la)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
c := &CountLiveAnchors{}
|
c := &CountLiveAnchors{}
|
||||||
|
|
||||||
c.UID = uuid.New().String()
|
c.UID = la.ObjectID.String()
|
||||||
c.IsCounted = 0
|
c.IsCounted = 0
|
||||||
c.CreateAt = la.CreateAt
|
c.CreateAt = la.CreateAt
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ func collectCopyCountLiveAnchors(cxt *WorkerContext) {
|
||||||
_, err = db.T.CountLiveAnchors.Insert(c)
|
_, err = db.T.CountLiveAnchors.Insert(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
ps.Wait(time.Second * 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user