diff --git a/link/service.go b/link/service.go index f6acee1..5afecf4 100644 --- a/link/service.go +++ b/link/service.go @@ -3,7 +3,6 @@ package link import ( apperrors "cgnolink/errors" "github.com/patrickmn/go-cache" - "time" ) type Service interface { @@ -22,7 +21,7 @@ type PgService struct { func NewPgService(rep PgRepository) PgService { return PgService{ rep: rep, - cache: cache.New(1*time.Hour, 90*time.Minute), + cache: cache.New(cache.NoExpiration, 0), } } @@ -59,7 +58,7 @@ func (s *PgService) GetById(id string) (*Link, error) { return nil, apperrors.NotFoundError{Message: "Link with given ID was not found."} } - s.cache.Set(id, link, 0) + s.cache.Set(id, link, cache.DefaultExpiration) return link, nil }