Explorar el Código

update 中基积分

tags/v4.2.1
DengBiao hace 1 año
padre
commit
0199930e56
Se han modificado 1 ficheros con 10 adiciones y 10 borrados
  1. +10
    -10
      rule/integral_release_settlement.go

+ 10
- 10
rule/integral_release_settlement.go Ver fichero

@@ -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)


Cargando…
Cancelar
Guardar