dengbiao 2 giorni fa
parent
commit
6bb07a3d29
2 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. +2
    -2
      rule/egg_energy/auto_release_green_energy.go
  2. +3
    -3
      rule/egg_energy/star_level_dividends.go

+ 2
- 2
rule/egg_energy/auto_release_green_energy.go Vedi File

@@ -21,8 +21,8 @@ const LockKey = "auto_release_exchange_team_egg_energy_lock_key"
func AutoReleaseExchangeTeamEggEnergy(engine *xorm.Engine) (err error) {
now := time.Now()
fmt.Println(now.Hour())
if !(now.Hour() > 1 && now.Hour() < 8) {
//TODO::只在凌晨点 ~ 凌晨 8 点运行
if !(now.Hour() > 2 && now.Hour() < 8) {
//TODO::只在凌晨2点 ~ 凌晨 8 点运行
return errors.New("非运行时间")
}
//TODO::增加“悲观锁”防止串行


+ 3
- 3
rule/egg_energy/star_level_dividends.go Vedi File

@@ -24,8 +24,8 @@ const SettlementStarLevelDividendsLockKey = "settlement_star_level_dividends_loc
func SettlementStarLevelDividends(engine *xorm.Engine, ch *rabbit.Channel) (err error) {
now := time.Now()
fmt.Println(now.Hour())
if !(now.Hour() > 2 && now.Hour() < 8) {
//TODO::只在凌晨点 ~ 凌晨 8 点运行
if !(now.Hour() > 1 && now.Hour() < 8) {
//TODO::只在凌晨1点 ~ 凌晨 8 点运行
return errors.New("非运行时间")
}
//TODO::增加“悲观锁”防止串行
@@ -147,7 +147,7 @@ func SettlementStarLevelDividends(engine *xorm.Engine, ch *rabbit.Channel) (err
userSignInArr = append(userSignInArr, l.Uid)
if len(userSignInArr) >= 10000 {
var users []*model.User
err = session.In("uid", userSignInArr).Find(&users)
err = session.In("id", userSignInArr).Find(&users)
if err != nil {
fmt.Println("err:::::7777777", err)
return err


Caricamento…
Annulla
Salva