small pixel drawing of a pufferfish vore

remove debug stuff
Jes Olson j3s@c3f.net
Wed, 14 Aug 2024 14:40:24 -0400
commit

9d6fb2a0444fa32ab8492924d49b3153f058241c

parent

d4511290c302f2afa0a86396e4655dfccd0b5695

3 files changed, 2 insertions(+), 18 deletions(-)

jump to
M main.gomain.go

@@ -3,7 +3,6 @@

import ( "log" "net/http" - _ "net/http/pprof" ) func main() {
M reaper/reaper.goreaper/reaper.go

@@ -3,7 +3,6 @@

import ( "errors" "log" - "runtime" "sort" "sync" "time"

@@ -11,13 +10,6 @@

"git.j3s.sh/vore/rss" "git.j3s.sh/vore/sqlite" ) - -func getAlloc() uint64 { - var m runtime.MemStats - runtime.GC() - runtime.ReadMemStats(&m) - return m.Alloc -} type Reaper struct { // internal list of all rss feeds where the map

@@ -54,9 +46,10 @@ r.feeds[url] = feed

} for { + start := time.Now() log.Println("reaper: refreshing all feeds") r.refreshAllFeeds() - log.Println("reaper: refreshed all feeds, sleeping 😴") + log.Printf("reaper: refreshed all feeds in %s! going to sleep 😴\n", time.Since(start)) time.Sleep(15 * time.Minute) } }

@@ -79,14 +72,8 @@ go func() {

defer wg.Done() for f := range ch { - log.Println() - log.Printf("got feed %s from chan\n", f.UpdateURL) - memBefore := getAlloc() start := time.Now() r.refreshFeed(f) - memAfter := getAlloc() - memUsed := memAfter - memBefore - log.Printf("memUsed: %dKB\n", memUsed/1024) log.Printf("reaper: %s refreshed in %s\n", f.UpdateURL, time.Since(start)) } }()
M rss/rss.gorss/rss.go

@@ -5,7 +5,6 @@ "bytes"

"errors" "fmt" "io" - "log" "net" "net/http" "strings"

@@ -154,7 +153,6 @@ if f.UpdateURL == "" {

return errors.New("feed has no URL") } - log.Printf("feed %s pre-items: %d\n", f.UpdateURL, len(f.Items)) if f.ItemMap == nil { f.ItemMap = make(map[string]struct{}) for _, item := range f.Items {