This commit is contained in:
aozhiwei 2022-02-11 17:39:35 +08:00
parent 65accf350c
commit cc31108abe
2 changed files with 17 additions and 27 deletions

View File

@ -44,6 +44,22 @@ class BoxOrder {
} }
} }
async mint() {
const logClass = 'mint';
if (!this.isMinted()) {
const found = await this.bcSearchToken();
if (!found) {
await this.bcMintHero();
}
}
await this.dbMintHero();
await this.updateDbMustBeSuccess(logClass,
[
['done', 1]
]);
utils.emitEvent(C.REMOVE_PENDING_ORDER_EVENT, this.getOrderId());
}
async sync() { async sync() {
if (!this.isSynced()) { if (!this.isSynced()) {
//查询 //查询
@ -210,32 +226,6 @@ class BoxOrder {
} }
} }
async mint() {
const logClass = 'mint';
log.info(util.format('%s begin orderDb:%s',
logClass,
utils.jsonEncode(this.getOrderDb()),
)
);
if (!this.isMinted()) {
const found = await this.bcSearchToken();
if (!found) {
await this.bcMintHero();
}
}
await this.dbMintHero();
await this.updateDbMustBeSuccess(logClass,
[
['done', 1]
]);
log.info(util.format('%s end orderDb:%s',
logClass,
utils.jsonEncode(this.getOrderDb()),
)
);
utils.emitEvent(C.REMOVE_PENDING_ORDER_EVENT, this.getOrderId());
}
async bcSearchToken() { async bcSearchToken() {
const logClass = 'bcSearchToken'; const logClass = 'bcSearchToken';
let events = []; let events = [];

View File

@ -17,7 +17,7 @@ async function addLog(type, subtype, param1, param2, param3, param4) {
['createtime', nowTime], ['createtime', nowTime],
['modifytime', nowTime], ['modifytime', nowTime],
]); ]);
if (!err) { if (err) {
log.warning('addLog ' + err); log.warning('addLog ' + err);
} }
} catch (err) { } catch (err) {