From 7573e47b77ccc3fe87aa1451026a1097f63f8a40 Mon Sep 17 00:00:00 2001 From: WeebDataHoarder <57538841+WeebDataHoarder@users.noreply.github.com> Date: Thu, 20 Jan 2022 00:28:45 +0100 Subject: [PATCH] Proper skip on invalidlist, reduce check time --- FinalCommander.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/FinalCommander.go b/FinalCommander.go index fc50065..1db08ab 100644 --- a/FinalCommander.go +++ b/FinalCommander.go @@ -170,7 +170,9 @@ func handle(ctx *httputils.RequestContext) { } if entry != nil { - for _, ci := range skip { + oldSkip := skip + skip = entry.InvalidList + for _, ci := range oldSkip { if !entry.InInvalidList(ci) { skip = append(skip, ci) } @@ -191,9 +193,6 @@ func handle(ctx *httputils.RequestContext) { //TODO: only trigger this when we don't get a 404 go func() { - - //e.CheckTime = time.Now().UTC().Unix() + 3600*24*365 //force a check next year as necessary - var newInvalidList []int var e *content.Entry @@ -258,7 +257,7 @@ func getContentEntry(key *content.HashIdentifier) *content.Entry { go func() { b, _ := entry.Encode() //Encode/decode to copy object e := content.DecodeEntry(entry.Key, b) - e.CheckTime = time.Now().UTC().Unix() + 3600*24*365 //force a check next year as necessary + e.CheckTime = time.Now().UTC().Unix() + 3600*24*30 //force a check every 30 days as they get fetched var newInvalidList []int