chore: format
This commit is contained in:
parent
b41fd4fef6
commit
d09a77cd2a
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user