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