This commit is contained in:
aozhiwei 2024-06-22 13:50:00 +08:00
parent 77101b6ce5
commit e25fee54a7
2 changed files with 58 additions and 88 deletions

View File

@ -23,102 +23,72 @@ func (this* repairNft) unInit() {
}
func (this* repairNft) processNft() {
var lastIdx int64
for true {
hasNextData := false
sql := fmt.Sprintf(`
f5.GetGoStyleDb().LoopLoad(
constant.BCNFT_DB,
func (lastIdx int64) string {
sql := fmt.Sprintf(`
SELECT * FROM nft WHERE idx > %d AND item_id = 0 LIMIT 1000`,
lastIdx,
)
f5.GetGoStyleDb().RawQuery(
constant.BCNFT_DB,
sql,
[]string{
},
func (err error, ds *f5.DataSet) {
if err == nil {
for ds.Next() {
idx := q5.ToInt64(ds.GetByName("idx"))
if idx > lastIdx {
lastIdx = idx
}
hasNextData = true
}
}
})
if hasNextData {
time.Sleep(time.Second * 10)
} else {
lastIdx = 0
time.Sleep(time.Second * 60 * 5)
}
}
lastIdx,
)
return sql
},
[]string{
},
func () time.Duration {
return time.Second * 10
},
func () time.Duration {
return time.Second * 60 * 5
},
func (ds *f5.DataSet) bool {
return true
})
}
func (this* repairNft) processOrder() {
var lastIdx int64
for true {
hasNextData := false
sql := fmt.Sprintf(`
f5.GetGoStyleDb().LoopLoad(
constant.BCNFT_DB,
func (lastIdx int64) string {
sql := fmt.Sprintf(`
SELECT * FROM nft WHERE idx > %d AND item_id = 0 LIMIT 1000`,
lastIdx,
)
f5.GetGoStyleDb().RawQuery(
constant.BCNFT_DB,
sql,
[]string{
},
func (err error, ds *f5.DataSet) {
if err == nil {
for ds.Next() {
idx := q5.ToInt64(ds.GetByName("idx"))
if idx > lastIdx {
lastIdx = idx
}
hasNextData = true
}
}
})
if hasNextData {
time.Sleep(time.Second * 10)
} else {
lastIdx = 0
time.Sleep(time.Second * 60 * 5)
}
}
lastIdx,
)
return sql
},
[]string{
},
func () time.Duration {
return time.Second * 10
},
func () time.Duration {
return time.Second * 60 * 5
},
func (ds *f5.DataSet) bool {
return true
})
}
func (this* repairNft) processSale() {
var lastIdx int64
for true {
hasNextData := false
sql := fmt.Sprintf(`
f5.GetGoStyleDb().LoopLoad(
constant.BCNFT_DB,
func (lastIdx int64) string {
sql := fmt.Sprintf(`
SELECT * FROM nft WHERE idx > %d AND item_id = 0 LIMIT 1000`,
lastIdx,
)
f5.GetGoStyleDb().RawQuery(
constant.BCNFT_DB,
sql,
[]string{
},
func (err error, ds *f5.DataSet) {
if err == nil {
for ds.Next() {
idx := q5.ToInt64(ds.GetByName("idx"))
if idx > lastIdx {
lastIdx = idx
}
hasNextData = true
}
}
})
if hasNextData {
time.Sleep(time.Second * 10)
} else {
lastIdx = 0
time.Sleep(time.Second * 60 * 5)
}
}
lastIdx,
)
return sql
},
[]string{
},
func () time.Duration {
return time.Second * 10
},
func () time.Duration {
return time.Second * 60 * 5
},
func (ds *f5.DataSet) bool {
return true
})
}
func (this* repairNft) getItemIdHeroQuality(netId int32, contractAddress string, tokenId string,

2
third_party/f5 vendored

@ -1 +1 @@
Subproject commit 330f53df3d6143867c0d78d97cdfb8bbd6c42ebb
Subproject commit 04c7b77bd79f7ce2dd706bc0ee3deb18d7bc7fd9