This commit is contained in:
aozhiwei 2023-07-13 15:53:15 +08:00
parent df58373bf5
commit 9b69e95f0f
3 changed files with 11 additions and 11 deletions

View File

@ -70,18 +70,18 @@ async function internalDbConn(app, name, method, ...args) {
}; };
} }
async function getBcEventConn(app, method, ...args) { async function execBcEventConn(app, method, ...args) {
return await internalDbConn(app, constant.BCEVENTDB_NAME, method, ...args); return await internalDbConn(app, constant.BCEVENTDB_NAME, method, ...args);
} }
async function getBcNftConn(app, method, ...args) { async function execBcNftConn(app, method, ...args) {
return await internalDbConn(app, constant.BCNFTDB_NAME, method, ...args); return await internalDbConn(app, constant.BCNFTDB_NAME, method, ...args);
} }
async function getGameConn(app, method, ...args) { async function execGameConn(app, method, ...args) {
return await internalDbConn(app, constant.GAMEDB_NAME, method, ...args); return await internalDbConn(app, constant.GAMEDB_NAME, method, ...args);
} }
exports.getBcEventConn = getBcEventConn; exports.execBcEventConn = execBcEventConn;
exports.getBcNftConn = getBcNftConn; exports.execBcNftConn = execBcNftConn;
exports.getGameConn = getGameConn; exports.execGameConn = execGameConn;

View File

@ -30,7 +30,7 @@ class Erc721Refresher extends BaseService {
async pullEvent() { async pullEvent() {
const logHead = this.genLogHead('pullEvent '); const logHead = this.genLogHead('pullEvent ');
try { try {
const {err, rows} = await dbpool.getBcEventConn( const {err, rows} = await dbpool.execBcEventConn(
app, app,
'execQuery', 'execQuery',
',SELECT * FROM t_erc721_refresh WHERE idx > ' + this.lastIdx.toString() + ' ' + ',SELECT * FROM t_erc721_refresh WHERE idx > ' + this.lastIdx.toString() + ' ' +
@ -208,7 +208,7 @@ class Erc721Refresher extends BaseService {
} }
async update(row, fields) { async update(row, fields) {
const {err} = await this.dbpool.getBcEventConn( const {err} = await this.dbpool.execBcEventConn(
app, app,
'update', 'update',
't_erc721_refresh', 't_erc721_refresh',

View File

@ -86,7 +86,7 @@ class PullBcEvent extends BaseService {
const firstBlockNumber = this.getInitBlock(); const firstBlockNumber = this.getInitBlock();
while (this.lastBlockNumber < 1) { while (this.lastBlockNumber < 1) {
try { try {
const {err, row} = await dbpool.getBcEventConn( const {err, row} = await dbpool.execBcEventConn(
app, app,
'ormSelectOne', 'ormSelectOne',
't_last_block', 't_last_block',
@ -134,7 +134,7 @@ class PullBcEvent extends BaseService {
async saveLastBlockNumber(blockNumber) { async saveLastBlockNumber(blockNumber) {
const logHead = this.genLogHead(' event_process.saveLastBlockNumber: '); const logHead = this.genLogHead(' event_process.saveLastBlockNumber: ');
while (true) { while (true) {
const {err} = await dbpool.getBcEventConn( const {err} = await dbpool.execBcEventConn(
app, app,
'upsert', 'upsert',
't_last_block', 't_last_block',
@ -172,7 +172,7 @@ class PullBcEvent extends BaseService {
const nowTime = utils.getUtcTime(); const nowTime = utils.getUtcTime();
const returnValues = event['returnValues']; const returnValues = event['returnValues'];
const hashCode = ''; const hashCode = '';
const {err} = await dbpool.getBcEventConn( const {err} = await dbpool.execBcEventConn(
app, app,
'upsert', 'upsert',
't_blockchain_event', 't_blockchain_event',