ソースを参照

update 中基积分

tags/v4.2.1
DengBiao 1年前
コミット
0199930e56
1個のファイルの変更10行の追加10行の削除
  1. +10
    -10
      rule/integral_release_settlement.go

+ 10
- 10
rule/integral_release_settlement.go ファイルの表示

@@ -175,16 +175,6 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str
return errors.New("非运行时间")
}

if isTask {
//TODO::增加“悲观锁”防止串行
getString, _ := cache.GetString(PessimismLockKeyForIntegralReleaseForInterposition)
if getString == PessimismLockValueForIntegralRelease {
fmt.Println("-----------------", "上一次结算未执行完")
return errors.New("上一次结算未执行完")
}
cache.SetEx(PessimismLockKeyForIntegralReleaseForInterposition, PessimismLockValueForIntegralRelease, 3600*10) //10小时
}

//1、查找 `integral_release` 基础设置
integralRelease, err := db.IntegralReleaseGetOneByParams(session, map[string]interface{}{
"key": "is_use",
@@ -199,6 +189,16 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str
return errors.New("今日“积分释放”未结算")
}

if isTask {
//TODO::增加“悲观锁”防止串行
getString, _ := cache.GetString(PessimismLockKeyForIntegralReleaseForInterposition)
if getString == PessimismLockValueForIntegralRelease {
fmt.Println("-----------------", "上一次结算未执行完")
return errors.New("上一次结算未执行完")
}
cache.SetEx(PessimismLockKeyForIntegralReleaseForInterposition, PessimismLockValueForIntegralRelease, 3600*10) //10小时
}

//2、查询所有 `integral_release_interposition_user_amount` 记录
var users []model.IntegralReleaseInterpositionUserAmount
err = session.Where("waite_amount > 0").Find(&users)


読み込み中…
キャンセル
保存