mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(federation): 🔊 Add more logging to some federation logic
This commit is contained in:
parent
ef0cca671a
commit
b333ecc816
2 changed files with 17 additions and 0 deletions
|
|
@ -716,6 +716,7 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
|||
}
|
||||
|
||||
public static async resolve(uri: string): Promise<User | null> {
|
||||
getLogger("federation").debug`Resolving user ${chalk.bold(uri)}`;
|
||||
// Check if user not already in database
|
||||
const foundUser = await User.fromSql(eq(Users.uri, uri));
|
||||
|
||||
|
|
@ -736,6 +737,9 @@ export class User extends BaseInterface<typeof Users, UserWithRelations> {
|
|||
return await User.fromId(uuid[0]);
|
||||
}
|
||||
|
||||
getLogger("federation")
|
||||
.debug`User not found in database, fetching from remote`;
|
||||
|
||||
return await User.saveFromRemote(uri);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue