chore: format

This commit is contained in:
ThatOneCalculator 2023-10-16 18:56:15 -07:00
parent b41fd4fef6
commit d09a77cd2a
No known key found for this signature in database
GPG Key ID: 8703CACD01000000

View File

@ -19,7 +19,6 @@ import type { IObject } from "./type.js";
import { getApId } from "./type.js"; import { getApId } from "./type.js";
import { resolvePerson, updatePerson } from "./models/person.js"; import { resolvePerson, updatePerson } from "./models/person.js";
const publicKeyCache = new Cache<UserPublickey | null>("publicKey", 60 * 30); const publicKeyCache = new Cache<UserPublickey | null>("publicKey", 60 * 30);
const publicKeyByUserIdCache = new Cache<UserPublickey | null>( const publicKeyByUserIdCache = new Cache<UserPublickey | null>(
"publicKeyByUserId", "publicKeyByUserId",
@ -205,9 +204,11 @@ export default class DbResolver {
}; };
} }
public async refetchPublicKeyForApId(user: CacheableRemoteUser): Promise<UserPublickey | null> { public async refetchPublicKeyForApId(
user: CacheableRemoteUser,
): Promise<UserPublickey | null> {
await updatePerson(user.uri!, undefined, undefined, user); await updatePerson(user.uri!, undefined, undefined, user);
let key = await UserPublickeys.findOneBy({ userId: user.id }); const key = await UserPublickeys.findOneBy({ userId: user.id });
if (key != null) { if (key != null) {
await publicKeyByUserIdCache.set(user.id, key); await publicKeyByUserIdCache.set(user.id, key);
} }