From 8ff823eca67284c9f098ca77e798b66ec8b52922 Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Tue, 6 Dec 2022 17:46:08 +0100 Subject: [PATCH] commit 1 of 2 of fixing the Account migration to Calckey --- packages/backend/src/models/entities/user.ts | 2 +- packages/backend/src/remote/resolve-user.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index 1fa46037d8..40ba3260ea 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -69,7 +69,7 @@ export class User { public followingCount: number; @Column('varchar', { - length: 512, nullable: true, + nullable: true, comment: 'The URI of the new account of the User', }) public movedToUri: string | null; diff --git a/packages/backend/src/remote/resolve-user.ts b/packages/backend/src/remote/resolve-user.ts index 6fc6f2c4d3..b44981bb83 100644 --- a/packages/backend/src/remote/resolve-user.ts +++ b/packages/backend/src/remote/resolve-user.ts @@ -49,9 +49,9 @@ export async function resolveUser(username: string, host: string | null): Promis return await createPerson(self.href); } - // ユーザー情報が古い場合は、WebFilgerからやりなおして返す + // If user information is out of date, return it by starting over from WebFilger if (user.lastFetchedAt == null || Date.now() - user.lastFetchedAt.getTime() > 1000 * 60 * 60 * 24) { - // 繋がらないインスタンスに何回も試行するのを防ぐ, 後続の同様処理の連続試行を防ぐ ため 試行前にも更新する + // Prevent multiple attempts to connect to unconnected instances, update before each attempt to prevent subsequent similar attempts await Users.update(user.id, { lastFetchedAt: new Date(), });