1
This commit is contained in:
parent
90333e6933
commit
6c84e42010
@ -148,7 +148,7 @@ CREATE TABLE `t_erc721_refresh` (
|
|||||||
`contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address',
|
`contract_address` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_address',
|
||||||
`contract_name` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_name',
|
`contract_name` varchar(60) NOT NULL DEFAULT '' COMMENT 'contract_name',
|
||||||
`token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
|
`token_id` varchar(60) NOT NULL DEFAULT '' COMMENT 'token_id',
|
||||||
`state` int(11) NOT NULL DEFAULT '0' COMMENT 'state',
|
`status` int(11) NOT NULL DEFAULT '0' COMMENT '0: dirty',
|
||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
PRIMARY KEY (`idx`),
|
PRIMARY KEY (`idx`),
|
||||||
|
@ -5,6 +5,8 @@ const log = require('j7/log');
|
|||||||
const constant = require('common/constant');
|
const constant = require('common/constant');
|
||||||
const BaseService = require('./baseservice');
|
const BaseService = require('./baseservice');
|
||||||
|
|
||||||
|
const LIMIT_COUNT = 100;
|
||||||
|
|
||||||
class Erc721Refresher extends BaseService {
|
class Erc721Refresher extends BaseService {
|
||||||
|
|
||||||
async init(bc, net, refresher) {
|
async init(bc, net, refresher) {
|
||||||
@ -27,6 +29,22 @@ class Erc721Refresher extends BaseService {
|
|||||||
|
|
||||||
async pullEvent() {
|
async pullEvent() {
|
||||||
const logHead = this.genLogHead('pullEvent ');
|
const logHead = this.genLogHead('pullEvent ');
|
||||||
|
try {
|
||||||
|
const {err, rows} = await this.conn.execQuery(
|
||||||
|
'SELECT * FROM t_erc721_refresh WHERE ' +
|
||||||
|
'AND net_id = ? AND contract_address = ? ' +
|
||||||
|
'LIMIT ' + LIMIT_COUNT,
|
||||||
|
[
|
||||||
|
this.getNetId(),
|
||||||
|
this.getContractAddress()
|
||||||
|
]);
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
log.error(logHead + err);
|
||||||
|
await utils.sleep(5000 + utils.randRange(1000, 3000));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getNetId() {
|
getNetId() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user