cache clean implemented

This commit is contained in:
2026-05-29 03:46:47 -06:00
parent a9de607743
commit 248c1370d7
9 changed files with 48 additions and 17 deletions
+4 -1
View File
@@ -9,6 +9,7 @@ import (
"strings"
"sync/atomic"
"testing"
"time"
"github.com/ewpt3ch/pkgstash/internal/cache"
"github.com/ewpt3ch/pkgstash/internal/repomaint"
@@ -39,8 +40,10 @@ func newTestServer(t *testing.T, mirrorHandler http.HandlerFunc) (*httptest.Serv
croot := t.TempDir()
mrepos := []string{"core"}
maxCacheSize := int64(1 * 1024 * 1024 * 1024)
maxCacheAge := time.Duration(time.Hour)
c, err := cache.NewCache(croot, []string{mirror.URL + "/"}, mrepos)
c, err := cache.NewCache(croot, []string{mirror.URL + "/"}, mrepos, maxCacheSize, maxCacheAge)
if err != nil {
t.Fatalf("failed to create cache: %v", err)
}