server: only cache public keys for 15min

This commit is contained in:
Johann150 2024-03-19 19:16:07 +01:00
parent ab22a1afa0
commit 6501c542b2
Signed by untrusted user: 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),
);