Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package main
import (
"sync"
"91porn-server/common/elastic"
"91porn-server/common/log"
"91porn-server/models"
"91porn-server/models/v/vidmod"
"91porn-server/skd/skdg"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo/options"
)
func syncVideoInfo(wg *sync.WaitGroup) {
log.Info("video sync start...")
for i := int64(0); ; i++ {
opts := options.Find().SetSkip(i * 1000).SetLimit(1000).SetSort(bson.D{{Key: "_id", Value: 1}})
vd, err := vidmod.GetListByCond(bson.M{}, opts)
if err != nil {
panic(err)
}
var source = elastic.M{}
for i := range vd {
tmp := vd[i]
source[vd[i].ID.Hex()] = tmp
}
if err := skdg.VideoES.Bulk(models.ESInfoVideoTable, source); err != nil {
panic(err)
}
vdLen := len(vd)
if vdLen < 1000 {
break
}
log.Info("video sync:", log.Any("start", i*1000), log.Any("end", i*1000+int64(vdLen)))
}
log.Info("video sync complete...")
wg.Done()
}