瀏覽代碼

update 中基积分

tags/v4.2.0
DengBiao 1 年之前
父節點
當前提交
e5c8cf7781
共有 1 個文件被更改,包括 9 次插入8 次删除
  1. +9
    -8
      rule/integral_release_settlement.go

+ 9
- 8
rule/integral_release_settlement.go 查看文件

@@ -63,14 +63,15 @@ func DailySettlementIntegralRelease(engine *xorm.Engine, mid string, isTask bool
_ = session.Rollback()
return errors.New("今日“积分释放”已结算")
}

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

//TODO::关闭系统
zhios_order_relate_utils.CurlPost("http://zhios-app:5000/api/v1/check_app_over_time", map[string]string{
@@ -201,7 +202,7 @@ func DailySettlementIntegralReleaseForInterposition(engine *xorm.Engine, mid str
//2、查询所有 `integral_release_interposition_user_amount` 记录
var users []model.IntegralReleaseInterpositionUserAmount
err = session.Where("waite_amount > 0").Find(&users)
if integralRelease.ReleaseDate != today {
if err != nil {
_ = session.Rollback()
return err
}


Loading…
取消
儲存