Skip to content

Commit

Permalink
fix: set pxat in set directly
Browse files Browse the repository at this point in the history
  • Loading branch information
psteinroe committed Nov 20, 2024
1 parent 9e31851 commit 24a83cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/postgrest-server/src/stores/redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ export class RedisStore implements Store {
}

public async set<Result>(key: string, entry: Entry<Result>): Promise<void> {
await this.redis.set(this.buildCacheKey(key), JSON.stringify(entry));
await this.redis.pexpireat(this.buildCacheKey(key), entry.staleUntil);
await this.redis.set(
this.buildCacheKey(key),
JSON.stringify(entry),
'PXAT',
entry.staleUntil,
);
}

public async remove(keys: string | string[]): Promise<void> {
Expand Down

0 comments on commit 24a83cb

Please sign in to comment.