Skip to content

Commit f3dd0f5

Browse files
committed
chore: change caching parameters
1 parent b4b84a8 commit f3dd0f5

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

apps/issuer-service/src/plugins/cache.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ declare module 'fastify' {
1414
}
1515

1616
export default fp(async (fastify, _) => {
17-
const store = new KeyvCacheableMemory({ ttl: '93d', lruSize: 5000 });
17+
const store = new KeyvCacheableMemory({ ttl: undefined, lruSize: 5000 });
1818
const keyv = new Keyv({ store });
1919
const flatCache = new FlatCache({
2020
cacheDir: path.join(process.cwd(), 'db/persistent-cache'),
21-
ttl: 8035200000, // 93 d
22-
lruSize: 10000, // 10000 items
21+
ttl: undefined,
22+
lruSize: 0,
2323
persistInterval: 1000 * 10, // 5 minutes
2424
});
2525

apps/issuer-service/src/routes/oidc/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -587,8 +587,6 @@ const route: FastifyPluginAsyncJsonSchemaToTs = async (
587587

588588
if (!cachedData) return reply.code(400).send();
589589

590-
await fastify.cache.del(data.id);
591-
592590
await fastify.cache.set(data.newId, cachedData);
593591
} catch (error) {
594592
return reply.code(401).send({

0 commit comments

Comments
 (0)