diff --git a/src/adapters.ts b/src/adapters.ts index 334b229..47a79a4 100644 --- a/src/adapters.ts +++ b/src/adapters.ts @@ -125,7 +125,7 @@ export function redisCacheAdapter(redisCache: RedisLikeCache): Cache { JSON.stringify(value), ttl > 0 && ttl < Infinity && typeof createdTime === 'number' ? { - EXAT: (ttl + createdTime) / 1000, + EXAT: Math.ceil((ttl + createdTime) / 1000), } : undefined, ); diff --git a/src/cachified.spec.ts b/src/cachified.spec.ts index 30e4bca..75baf90 100644 --- a/src/cachified.spec.ts +++ b/src/cachified.spec.ts @@ -1171,7 +1171,7 @@ describe('cachified', () => { metadata: { ttl: 1, swr: 0, createdTime: 0 }, value: 'FOUR', }), - { EXAT: 0.001 }, + { EXAT: 1 }, ); await cache.set('lel', undefined as any);