1
This commit is contained in:
parent
65accf350c
commit
cc31108abe
@ -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 = [];
|
||||||
|
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user