diff --git a/server/web3bcspider/services/erc721_refresher.js b/server/web3bcspider/services/erc721_refresher.js index a6946aa..00313e9 100644 --- a/server/web3bcspider/services/erc721_refresher.js +++ b/server/web3bcspider/services/erc721_refresher.js @@ -15,6 +15,7 @@ class Erc721Refresher extends BaseService { this.bc = bc; this.net = net; this.refresher = refresher; + this.lastIdx = BigInt(0); this.conf = this.refresher['conf']; this.progInfo = this.refresher['progressInfo']; await this.start(); @@ -31,7 +32,7 @@ class Erc721Refresher extends BaseService { const logHead = this.genLogHead('pullEvent '); try { const {err, rows} = await this.conn.execQuery( - 'SELECT * FROM t_erc721_refresh WHERE ' + + 'SELECT * FROM t_erc721_refresh WHERE idx > ' + this.lastIdx.toString() + ' ' + 'AND net_id = ? AND contract_address = ? AND status = 0 ' + 'LIMIT ' + LIMIT_COUNT, [ @@ -48,6 +49,8 @@ class Erc721Refresher extends BaseService { await this.refresh(row); } ); + } else { + this.lastIdx = BigInt(0); } } catch (err) { log.error(logHead + err);