From 35ab855916b5861a009465b4a35af8cd51e02a5f Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Wed, 9 Oct 2024 14:35:00 +0530 Subject: [PATCH] fix: correct cache alias lookup --- api/cache.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/cache.go b/api/cache.go index 28723b35..c10fb9ce 100644 --- a/api/cache.go +++ b/api/cache.go @@ -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 } }