vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
Remove page-view tracking
0a12642f6c01236d1fbd4ee06aaa2bd2283c6bf0 · Keenan Nemetz · 3d ago · parent 8f6548a6
Remove page-view tracking Counting a page wrote a row to instance.db on every successful HTML GET, so reading the instance contended with CI and the merge worker for the one write lock. The counters answered one status page and were not part of what a restore has to keep, so the feature is gone rather than moved. The status overview loses its page-view card and table; the rest of the Admin page is unchanged. An instance that recorded views keeps the old page_views table in instance.db, which nothing reads. Refs #398
forge/pageview/pageview_test.go −56
| @@ -1,56 +0,0 @@ | |||
| 1 | package pageview | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "os" | ||
| 5 | "path/filepath" | ||
| 6 | "testing" | ||
| 7 | "time" | ||
| 8 | ) | ||
| 9 | |||
| 10 | func TestPageViewsAggregateDailyAndUniqueUsers(t *testing.T) { | ||
| 11 | t.Parallel() | ||
| 12 | path := filepath.Join(t.TempDir(), "instance.db") | ||
| 13 | if err := touch(path); err != nil { | ||
| 14 | t.Fatal(err) | ||
| 15 | } | ||
| 16 | s, err := Open(path) | ||
| 17 | if err != nil { | ||
| 18 | t.Fatal(err) | ||
| 19 | } | ||
| 20 | defer s.Close() | ||
| 21 | |||
| 22 | now := time.Date(2026, 10, 26, 12, 0, 0, 0, time.UTC) | ||
| 23 | for _, account := range []string{"alice", "alice", "bob", ""} { | ||
| 24 | if err := s.Record(account, now); err != nil { | ||
| 25 | t.Fatal(err) | ||
| 26 | } | ||
| 27 | } | ||
| 28 | if err := s.Record("alice", now.AddDate(0, 0, -3)); err != nil { | ||
| 29 | t.Fatal(err) | ||
| 30 | } | ||
| 31 | if err := s.Record("bob", now.AddDate(0, 0, -40)); err != nil { | ||
| 32 | t.Fatal(err) | ||
| 33 | } | ||
| 34 | |||
| 35 | got, err := s.Stats(now) | ||
| 36 | if err != nil { | ||
| 37 | t.Fatal(err) | ||
| 38 | } | ||
| 39 | if got.Today.Views != 4 || got.Today.Users != 2 { | ||
| 40 | t.Fatalf("today = %+v, want 4 views and 2 users", got.Today) | ||
| 41 | } | ||
| 42 | if got.Week.Views != 5 || got.Week.Users != 2 { | ||
| 43 | t.Fatalf("week = %+v, want 5 views and 2 users", got.Week) | ||
| 44 | } | ||
| 45 | if got.Month.Views != 5 || got.Month.Users != 2 { | ||
| 46 | t.Fatalf("month = %+v, want 5 views and 2 users; the 40-day-old row should be excluded", got.Month) | ||
| 47 | } | ||
| 48 | } | ||
| 49 | |||
| 50 | func touch(path string) error { | ||
| 51 | f, err := os.Create(path) | ||
| 52 | if err != nil { | ||
| 53 | return err | ||
| 54 | } | ||
| 55 | return f.Close() | ||
| 56 | } | ||