|
@@ -19,16 +19,20 @@ var liveactiveRTB = "liveactiveRTB"
|
|
|
// 23~7 -9
|
|
|
func Buynum() {
|
|
|
log.Println("开始生成:", time.Now().Format(util.Date_Full_Layout))
|
|
|
- log.Println("预计结束时间:", time.Unix(config.Conf.Endlive, 0).Format(util.Date_Full_Layout))
|
|
|
+ log.Println("预计结束时间:", time.Unix(config.Conf.Endtime, 0).Format(util.Date_Full_Layout))
|
|
|
i := util.If(redis.GetInt("other", liveactiveRTB) > 0, redis.GetInt("other", liveactiveRTB), 1)
|
|
|
for {
|
|
|
+ if time.Now().Unix() >= config.Conf.Endtime {
|
|
|
+ log.Println("结束。。。", time.Now().Format(util.Date_Full_Layout), "人数:", redis.Get("other", liveactiveRTB))
|
|
|
+ return
|
|
|
+ }
|
|
|
hour := time.Now().Hour()
|
|
|
if hour < 8 || hour >= 23 {
|
|
|
if time.Now().Minute() == 13 {
|
|
|
i = redis.GetInt("other", liveactiveRTB) + 1
|
|
|
}
|
|
|
} else {
|
|
|
- start := time.Unix(config.Conf.Endlive, 0).AddDate(0, 0, -4)
|
|
|
+ start := time.Unix(config.Conf.Endtime, 0).AddDate(0, 0, -4)
|
|
|
random := big.NewInt(8)
|
|
|
if time.Now().Day() < start.Day() {
|
|
|
random = big.NewInt(11)
|
|
@@ -37,12 +41,8 @@ func Buynum() {
|
|
|
log.Println("新增:", result)
|
|
|
i = redis.GetInt("other", liveactiveRTB) + int(result.Int64())
|
|
|
}
|
|
|
- timeout := config.Conf.Endlive + 60*60*24*30 - time.Now().Unix()
|
|
|
+ timeout := config.Conf.Endtime + 60*60*24*30 - time.Now().Unix()
|
|
|
redis.Put("other", liveactiveRTB, i, int(timeout))
|
|
|
- if time.Now().Unix() >= config.Conf.Endlive {
|
|
|
- log.Println("结束。。。", time.Now().Format(util.Date_Full_Layout), "人数:", redis.Get("other", liveactiveRTB))
|
|
|
- return
|
|
|
- }
|
|
|
time.Sleep(time.Second * 60)
|
|
|
}
|
|
|
}
|