通知alchmy时,如果网络问题, 那么重试6ci
This commit is contained in:
parent
a71402dcbc
commit
804d1883a9
@ -42,7 +42,7 @@ AGOR_WALLET='0x50A8e60041A206AcaA5F844a1104896224be6F39'
|
||||
PAY_TRANSFER_CB_URL='http://127.0.0.1:3007/api/internal/update_task'
|
||||
# 链端回调hash的ket
|
||||
HASH_SALT='iG4Rpsa)6U31$H#^T85$^^3'
|
||||
|
||||
HASH_SALT_CHAIN='iG4Rpsa)6U31$H#^T85$^^3'
|
||||
# 游戏服, 支付上报地址
|
||||
GAME_PAY_CB_URL=https://game2006api-test.kingsome.cn/webapp/index.php
|
||||
REDIS=redis://127.0.0.1:6379/14
|
||||
|
@ -11,7 +11,7 @@ import { PriceSvr } from 'service/price.svr'
|
||||
|
||||
const calcHash = function (data: any) {
|
||||
let signStr = JSON.stringify(data)
|
||||
return hmacsha256(signStr, process.env.HASH_SALT)
|
||||
return hmacsha256(signStr, process.env.HASH_SALT_CHAIN)
|
||||
}
|
||||
|
||||
const notify = async function (record: DocumentType<PayRecordClass>, subTask: DocumentType<TransferRecordClass>) {
|
||||
@ -37,6 +37,11 @@ const notify = async function (record: DocumentType<PayRecordClass>, subTask: Do
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error(`notify alchemy error:: ${err.message}`)
|
||||
record.notofyErrCount = record.notofyErrCount + 1
|
||||
await record.save()
|
||||
if (record.notofyErrCount < 6) {
|
||||
await notify(record, subTask)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ export class PayRecordClass extends BaseModule {
|
||||
|
||||
// 开始创建记录时, 估算的可获取加密货币数量
|
||||
@prop()
|
||||
public cryptoAmountEstimate: string
|
||||
public cryptoAmountEstimate?: string
|
||||
|
||||
// 加密货币价格
|
||||
@prop()
|
||||
@ -107,6 +107,12 @@ export class PayRecordClass extends BaseModule {
|
||||
@prop({ default: 0 })
|
||||
public tranStatus: number
|
||||
|
||||
/**
|
||||
* 国库模式通知alchemy次数
|
||||
*/
|
||||
@prop({ default: 0 })
|
||||
public notofyErrCount: number
|
||||
|
||||
/**
|
||||
* 上报游戏服状态
|
||||
* 0: 未上报
|
||||
|
Loading…
x
Reference in New Issue
Block a user