tuned default precene fetch
This commit is contained in:
@@ -13,23 +13,18 @@ import (
|
||||
)
|
||||
|
||||
func (h *Handler) Prescene() string {
|
||||
pagesToScrape := []string{"1"}
|
||||
currMinute := time.Now().Minute()
|
||||
levels := viper.GetInt(constant.CfgKeyLevelsToScrape)
|
||||
initPage := strconv.Itoa(currMinute/(60/levels) + 1)
|
||||
pagesToScrape := []string{initPage}
|
||||
|
||||
if levels > 1 {
|
||||
var q = (60.0 / 100.0) * (100.0 / viper.GetFloat64(constant.CfgKeyLevelsToScrape))
|
||||
minute := float64(time.Now().Minute())
|
||||
if minute < 1 {
|
||||
minute = 1
|
||||
}
|
||||
var q = (60.0 / 100.0) * (100.0 / float64(levels))
|
||||
minute := float64(currMinute + 1)
|
||||
|
||||
fmt.Printf("FLOAT: %f, %f, %v\n", minute, q, math.Ceil(minute/q))
|
||||
|
||||
hour := time.Now().Hour()
|
||||
if hour == 1 {
|
||||
hour = 25
|
||||
} else if hour == 0 {
|
||||
hour = 1
|
||||
}
|
||||
hour := time.Now().Hour() + levels
|
||||
|
||||
page := hour * int(math.Ceil(minute/q))
|
||||
pagesToScrape = append(pagesToScrape, strconv.Itoa(page))
|
||||
|
||||
Reference in New Issue
Block a user