new test for streaming and struct changes and additions

This commit is contained in:
2026-05-14 09:24:04 -06:00
parent 98a61e0137
commit f25d36a17e
4 changed files with 87 additions and 27 deletions
+3 -3
View File
@@ -3,10 +3,10 @@ package cache
import "path/filepath"
func (c *Cache) Refresh() error {
if !c.mu.TryLock() {
if !c.refreshMu.TryLock() {
return nil
}
defer c.mu.Unlock()
defer c.refreshMu.Unlock()
for _, repo := range c.cfg.mirroredRepos {
if err := c.refreshDB(repo); err != nil {
@@ -19,7 +19,7 @@ func (c *Cache) Refresh() error {
func (c *Cache) refreshDB(repo string) error {
dbFile := repo + ".db.tar.gz"
dbPath := filepath.Join(repo, "os/x86_64", dbFile)
err := c.fetch(dbPath)
err := c.getStream(dbPath)
if err != nil {
return err
}