diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go index 9b908bf..eb02574 100644 --- a/pkg/cache/cache.go +++ b/pkg/cache/cache.go @@ -155,5 +155,5 @@ func IsExpired(expire time.Time, now *time.Time) bool { now = &tmp } - return now.Unix() >= expire.Unix() + return now.After(expire) } diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index ef6f45d..bbb0ec9 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -55,7 +55,7 @@ func TestIsExpired(t *testing.T) { assert.NoError(err) result = IsExpired(expirationTime, &now) - assert.True(result) + assert.False(result) now, err = time.Parse(layout, "2024-10-04 22:23:00") assert.NoError(err)