Increase general expiry time (1h per 200 classes), decrease priority time (33%) boost

This commit is contained in:
2024-01-30 12:47:05 -06:00
parent 000eab55b9
commit 63922b7ea1

View File

@@ -141,8 +141,8 @@ func ScrapeMajor(subject string) error {
}
}
// Calculate the expiry time for the scrape (1 hour for every 500 classes, random +-15%) with a minimum of 1 hour
scrapeExpiry := time.Hour * time.Duration(totalClassCount/500)
// Calculate the expiry time for the scrape (1 hour for every 200 classes, random +-15%) with a minimum of 1 hour
scrapeExpiry := time.Hour * time.Duration(totalClassCount/200)
partial := scrapeExpiry.Seconds() * 0.15
if rand.Intn(2) == 0 {
scrapeExpiry -= time.Duration(partial) * time.Second
@@ -157,7 +157,7 @@ func ScrapeMajor(subject string) error {
// If the subject is a priority, then the expiry is halved
if lo.Contains(PriorityMajors, subject) {
scrapeExpiry /= 2
scrapeExpiry /= 3
}
// Mark the major as scraped