[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> {
|
||||
await updatePerson(user.uri!, undefined, undefined, user);
|
||||
let key = await UserPublickeys.findOneBy({ userId: user.id });
|
||||
if (key != null) {
|
||||
await publicKeyByUserIdCache.set(user.id, key);
|
||||
try {
|
||||
await updatePerson(user.uri!, undefined, undefined, user);
|
||||
let key = await UserPublickeys.findOneBy({ userId: user.id });
|
||||
if (key != null) {
|
||||
await publicKeyByUserIdCache.set(user.id, key);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue