Skip to content

Commit

Permalink
fix: correct cache alias lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
yashmehrotra authored and moshloop committed Oct 9, 2024
1 parent 490e3d4 commit 35ab855
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ func (t *TempCache) Insert(item models.ConfigItem) {
t.items = make(map[string]models.ConfigItem)
}

scraperID := lo.FromPtr(item.ScraperID).String()
for _, id := range item.ExternalID {
if item.Type != nil {
t.aliases[lo.FromPtr(item.ScraperID).String()+strings.ToLower(*item.Type)+id] = item.ID
t.aliases[strings.ToLower(*item.Type)+strings.ToLower(id)+scraperID] = item.ID
} else {
t.aliases[lo.FromPtr(item.ScraperID).String()+strings.ToLower(id)] = item.ID
t.aliases[strings.ToLower(id)+scraperID] = item.ID
}
}

Expand Down

0 comments on commit 35ab855

Please sign in to comment.