1
This commit is contained in:
parent
d468d6d48c
commit
6c3ae9d9a8
@ -1,5 +1,13 @@
|
|||||||
package task
|
package task
|
||||||
|
|
||||||
|
import (
|
||||||
|
"q5"
|
||||||
|
"f5"
|
||||||
|
"time"
|
||||||
|
"fmt"
|
||||||
|
"main/constant"
|
||||||
|
)
|
||||||
|
|
||||||
type repairNft struct {
|
type repairNft struct {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -12,4 +20,34 @@ func (this* repairNft) unInit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this* repairNft) process() {
|
func (this* repairNft) process() {
|
||||||
|
var lastIdx int64
|
||||||
|
for true {
|
||||||
|
hasNextData := false
|
||||||
|
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 * 5)
|
||||||
|
} else {
|
||||||
|
lastIdx = 0
|
||||||
|
time.Sleep(time.Second * 60 * 5)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,5 +52,5 @@ SELECT * FROM t_721nft_spec_transfer WHERE idx > %d LIMIT 1000`,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this* specTransfer721) process(ds *f5.DataSet) {
|
func (this* specTransfer721) process1(ds *f5.DataSet) {
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user