server: only cache public keys for 15min
Some checks failed
ci/woodpecker/push/lint-backend Pipeline failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline failed
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-sw Pipeline failed
ci/woodpecker/push/test Pipeline failed

This commit is contained in:
Johann150 2024-03-19 19:16:07 +01:00
parent ab22a1afa0
commit 6501c542b2
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -18,11 +18,11 @@ export const uriPersonCache = new Cache<User>(
async (uri) => await Users.findOneBy({ uri, isDeleted: IsNull() }) ?? undefined,
);
export const publicKeyCache = new Cache<UserPublickey>(
2 * HOUR,
15 * MINUTE,
(keyId) => UserPublickeys.findOneBy({ keyId }).then(x => x ?? undefined),
);
export const publicKeyByUserIdCache = new Cache<UserPublickey>(
2 * HOUR,
15 * MINUTE,
(userId) => UserPublickeys.findOneBy({ userId }).then(x => x ?? undefined),
);