feat: add option to log the n most active IPs each hour (#496)

Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/496
Co-authored-by: crapStone <me@crapstone.dev>
Co-committed-by: crapStone <me@crapstone.dev>
This commit is contained in:
crapStone 2025-06-25 22:12:33 +02:00 committed by crapStone
parent d27c594c28
commit 5477ba2c46
8 changed files with 97 additions and 5 deletions

View file

@ -3,6 +3,7 @@ package handler
import (
"net/http"
"net/http/httptest"
"sync"
"testing"
"time"
@ -29,7 +30,7 @@ func TestHandlerPerformance(t *testing.T) {
AllowedCorsDomains: []string{"raw.codeberg.org", "fonts.codeberg.org", "design.codeberg.org"},
PagesBranches: []string{"pages"},
}
testHandler := Handler(serverCfg, giteaClient, cache.NewInMemoryCache(), cache.NewInMemoryCache())
testHandler := Handler(serverCfg, giteaClient, cache.NewInMemoryCache(), cache.NewInMemoryCache(), &sync.Map{})
testCase := func(uri string, status int) {
t.Run(uri, func(t *testing.T) {