mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 03:17:38 -07:00
[backend] Catch errors in refetchPublicKeyForApId
This commit is contained in:
parent
3b85491ee4
commit
9b13ec9c0c
1 changed files with 10 additions and 5 deletions
|
@ -206,12 +206,17 @@ 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);
|
try {
|
||||||
let key = await UserPublickeys.findOneBy({ userId: user.id });
|
await updatePerson(user.uri!, undefined, undefined, user);
|
||||||
if (key != null) {
|
let key = await UserPublickeys.findOneBy({ userId: user.id });
|
||||||
await publicKeyByUserIdCache.set(user.id, key);
|
if (key != null) {
|
||||||
|
await publicKeyByUserIdCache.set(user.id, key);
|
||||||
|
}
|
||||||
|
return key;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return key;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue