Sfoglia il codice sorgente

update

tags/v4.0.1
DengBiao 1 anno fa
parent
commit
114e15acfb
1 ha cambiato i file con 8 aggiunte e 6 eliminazioni
  1. +8
    -6
      rule/integral_release_settlement.go

+ 8
- 6
rule/integral_release_settlement.go Vedi File

@@ -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{}{


Caricamento…
Annulla
Salva