diff --git a/act/artifactcache/handler.go b/act/artifactcache/handler.go index b50b6b11..0f78be85 100644 --- a/act/artifactcache/handler.go +++ b/act/artifactcache/handler.go @@ -422,7 +422,7 @@ func findCache(db *bolthold.Store, repo string, keys []string, version string) ( for _, prefix := range keys { // if a key in the list matches exactly, don't return partial matches if err := db.FindOne(cache, - bolthold.Where("Repo").Eq(repo). + bolthold.Where("Repo").Eq(repo).Index("Repo"). And("Key").Eq(prefix). And("Version").Eq(version). And("Complete").Eq(true). @@ -438,7 +438,7 @@ func findCache(db *bolthold.Store, repo string, keys []string, version string) ( continue } if err := db.FindOne(cache, - bolthold.Where("Repo").Eq(repo). + bolthold.Where("Repo").Eq(repo).Index("Repo"). And("Key").RegExp(re). And("Version").Eq(version). And("Complete").Eq(true). diff --git a/act/artifactcache/model.go b/act/artifactcache/model.go index 1c0f855d..b27fd8ed 100644 --- a/act/artifactcache/model.go +++ b/act/artifactcache/model.go @@ -26,10 +26,10 @@ func (c *Request) ToCache() *Cache { type Cache struct { ID uint64 `json:"id" boltholdKey:"ID"` Repo string `json:"repo" boltholdIndex:"Repo"` - Key string `json:"key" boltholdIndex:"Key"` - Version string `json:"version" boltholdIndex:"Version"` + Key string `json:"key"` + Version string `json:"version"` Size int64 `json:"cacheSize"` - Complete bool `json:"complete" boltholdIndex:"Complete"` - UsedAt int64 `json:"usedAt" boltholdIndex:"UsedAt"` - CreatedAt int64 `json:"createdAt" boltholdIndex:"CreatedAt"` + Complete bool `json:"complete"` + UsedAt int64 `json:"usedAt"` + CreatedAt int64 `json:"createdAt"` }