From 2453fe4b5a9f53044bb4dfc47104ce97b3def9c0 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 24 Dec 2024 13:49:59 +0800 Subject: [PATCH] update --- rule/egg_energy/star_level_dividends.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rule/egg_energy/star_level_dividends.go b/rule/egg_energy/star_level_dividends.go index f9bc03c..35c1add 100644 --- a/rule/egg_energy/star_level_dividends.go +++ b/rule/egg_energy/star_level_dividends.go @@ -24,17 +24,17 @@ 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() > 1 && now.Hour() < 8) { - //TODO::只在凌晨1点 ~ 凌晨 8 点运行 - return errors.New("非运行时间") - } + //if !(now.Hour() > 1 && now.Hour() < 8) { + // //TODO::只在凌晨1点 ~ 凌晨 8 点运行 + // return errors.New("非运行时间") + //} //TODO::增加“悲观锁”防止串行 getString, _ := cache.GetString(SettlementStarLevelDividendsLockKey) if getString != "" { fmt.Println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", "上一次结算未执行完") return errors.New("上一次结算未执行完") } - cache.SetEx(SettlementStarLevelDividendsLockKey, "running", 3600*8) //8小时 + cache.SetEx(SettlementStarLevelDividendsLockKey, "running", 3600*12) //8小时 //1、查找 `egg_energy_basic_setting` 基础设置 eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine) @@ -214,7 +214,7 @@ func SettlementStarLevelDividends(engine *xorm.Engine, ch *rabbit.Channel) (err if len(userSignInArr) > 0 { 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