This commit is contained in:
aozhiwei 2024-09-03 10:23:47 +08:00
parent 84cbb9f6e5
commit 3e5fccd132

View File

@ -26,17 +26,17 @@ func (this *stackingCec) unInit() {
}
func (this *stackingCec) process(netId int32, contractAddress string) {
key := fmt.Sprintf("recharge.lastIdx.%d.%s", netId, contractAddress)
key := fmt.Sprintf("stackingCec.lastIdx.%d.%s", netId, contractAddress)
if dbLastIdxStr, err := jccommon.GetDbParam(constant.BCEVENT_DB, key); err == nil {
f5.GetGoStyleDb().IncrementLoad(
constant.BCEVENT_DB,
"recharge." + q5.ToString(netId) + "." + contractAddress,
"stackingCec." + q5.ToString(netId) + "." + contractAddress,
"t_blockchain_event",
q5.ToInt64(dbLastIdxStr),
func (lastIdx int64, maxIdx int64) (string, []string) {
sql := fmt.Sprintf(`
SELECT * FROM t_blockchain_event
WHERE idx > %d AND idx <= %d AND net_id = %d AND contract_address = ? AND event_name = ?
WHERE idx > %d AND idx <= %d AND net_id = %d AND contract_address = ? AND event_name IN (?, ?)
ORDER BY idx LIMIT 1000
`,
lastIdx,
@ -44,7 +44,8 @@ ORDER BY idx LIMIT 1000
netId)
params := []string{
contractAddress,
"ItemSoldOut",
"StakeCec",
"UnstakeCec",
}
return sql, params
},
@ -53,7 +54,7 @@ ORDER BY idx LIMIT 1000
},
this.saveToDb)
} else {
panic(fmt.Sprintf("recharge.process getDBParam error %s", err))
panic(fmt.Sprintf("stackingCec.process getDBParam error %s", err))
}
}