diff --git a/.env.development b/.env.development index e3b07e8..c0b7875 100644 --- a/.env.development +++ b/.env.development @@ -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 diff --git a/src/controllers/internal.controller.ts b/src/controllers/internal.controller.ts index f590937..7691e49 100644 --- a/src/controllers/internal.controller.ts +++ b/src/controllers/internal.controller.ts @@ -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, subTask: DocumentType) { @@ -37,6 +37,11 @@ const notify = async function (record: DocumentType, 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) + } } } diff --git a/src/modules/PayRecord.ts b/src/modules/PayRecord.ts index 92f730b..54779ed 100644 --- a/src/modules/PayRecord.ts +++ b/src/modules/PayRecord.ts @@ -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: 未上报