DengBiao преди 1 година
родител
ревизия
114e15acfb
променени са 1 файла, в които са добавени 8 реда и са изтрити 6 реда
  1. +8
    -6
      rule/integral_release_settlement.go

+ 8
- 6
rule/integral_release_settlement.go Целия файл

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

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

//1、查找 `integral_release` 基础设置
integralRelease, err := db.IntegralReleaseGetOneByParams(session, map[string]interface{}{


Зареждане…
Отказ
Запис