1
This commit is contained in:
parent
4bf1275386
commit
df58373bf5
@ -3,6 +3,7 @@ const utils = require('j7/utils');
|
|||||||
const bcutils = require('j7/bcutils');
|
const bcutils = require('j7/bcutils');
|
||||||
const log = require('j7/log');
|
const log = require('j7/log');
|
||||||
const constant = require('common/constant');
|
const constant = require('common/constant');
|
||||||
|
const dbpool = require('common/dbpool');
|
||||||
const BaseService = require('./baseservice');
|
const BaseService = require('./baseservice');
|
||||||
|
|
||||||
const LIMIT_COUNT = 100;
|
const LIMIT_COUNT = 100;
|
||||||
@ -10,8 +11,6 @@ const LIMIT_COUNT = 100;
|
|||||||
class Erc721Refresher extends BaseService {
|
class Erc721Refresher extends BaseService {
|
||||||
|
|
||||||
async init(bc, net, refresher) {
|
async init(bc, net, refresher) {
|
||||||
const {err, conn} = await app.getDbConn(constant.BCEVENTDB_NAME);
|
|
||||||
this.conn = conn;
|
|
||||||
this.bc = bc;
|
this.bc = bc;
|
||||||
this.net = net;
|
this.net = net;
|
||||||
this.refresher = refresher;
|
this.refresher = refresher;
|
||||||
@ -31,8 +30,10 @@ class Erc721Refresher extends BaseService {
|
|||||||
async pullEvent() {
|
async pullEvent() {
|
||||||
const logHead = this.genLogHead('pullEvent ');
|
const logHead = this.genLogHead('pullEvent ');
|
||||||
try {
|
try {
|
||||||
const {err, rows} = await this.conn.execQuery(
|
const {err, rows} = await dbpool.getBcEventConn(
|
||||||
'SELECT * FROM t_erc721_refresh WHERE idx > ' + this.lastIdx.toString() + ' ' +
|
app,
|
||||||
|
'execQuery',
|
||||||
|
',SELECT * FROM t_erc721_refresh WHERE idx > ' + this.lastIdx.toString() + ' ' +
|
||||||
'AND net_id = ? AND contract_address = ? AND status = 0 ' +
|
'AND net_id = ? AND contract_address = ? AND status = 0 ' +
|
||||||
'LIMIT ' + LIMIT_COUNT,
|
'LIMIT ' + LIMIT_COUNT,
|
||||||
[
|
[
|
||||||
@ -207,7 +208,9 @@ class Erc721Refresher extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update(row, fields) {
|
async update(row, fields) {
|
||||||
const {err} = await this.conn.update(
|
const {err} = await this.dbpool.getBcEventConn(
|
||||||
|
app,
|
||||||
|
'update',
|
||||||
't_erc721_refresh',
|
't_erc721_refresh',
|
||||||
[
|
[
|
||||||
['idx', row['idx']],
|
['idx', row['idx']],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user