refactor: migrate to typeorm 3.0 (#8443)

* wip

* wip

* wip

* Update following.ts

* wip

* wip

* wip

* Update resolve-user.ts

* maxQueryExecutionTime

* wip

* wip
This commit is contained in:
syuilo
2022-03-26 15:34:00 +09:00
committed by GitHub
parent 41c87074e6
commit 1c67c26bd8
325 changed files with 1314 additions and 1494 deletions

View File

@@ -22,11 +22,11 @@ export default class InstanceChart extends Chart<typeof schema> {
followersCount,
driveFiles,
] = await Promise.all([
Notes.count({ userHost: group }),
Users.count({ host: group }),
Followings.count({ followerHost: group }),
Followings.count({ followeeHost: group }),
DriveFiles.count({ userHost: group }),
Notes.countBy({ userHost: group }),
Users.countBy({ host: group }),
Followings.countBy({ followerHost: group }),
Followings.countBy({ followeeHost: group }),
DriveFiles.countBy({ userHost: group }),
]);
return {

View File

@@ -15,8 +15,8 @@ export default class NotesChart extends Chart<typeof schema> {
protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
const [localCount, remoteCount] = await Promise.all([
Notes.count({ userHost: null }),
Notes.count({ userHost: Not(IsNull()) }),
Notes.countBy({ userHost: IsNull() }),
Notes.countBy({ userHost: Not(IsNull()) }),
]);
return {

View File

@@ -14,7 +14,7 @@ export default class PerUserDriveChart extends Chart<typeof schema> {
protected async tickMajor(group: string): Promise<Partial<KVs<typeof schema>>> {
const [count, size] = await Promise.all([
DriveFiles.count({ userId: group }),
DriveFiles.countBy({ userId: group }),
DriveFiles.calcDriveUsageOf(group),
]);

View File

@@ -20,10 +20,10 @@ export default class PerUserFollowingChart extends Chart<typeof schema> {
remoteFollowingsCount,
remoteFollowersCount,
] = await Promise.all([
Followings.count({ followerId: group, followeeHost: null }),
Followings.count({ followeeId: group, followerHost: null }),
Followings.count({ followerId: group, followeeHost: Not(IsNull()) }),
Followings.count({ followeeId: group, followerHost: Not(IsNull()) }),
Followings.countBy({ followerId: group, followeeHost: IsNull() }),
Followings.countBy({ followeeId: group, followerHost: IsNull() }),
Followings.countBy({ followerId: group, followeeHost: Not(IsNull()) }),
Followings.countBy({ followeeId: group, followerHost: Not(IsNull()) }),
]);
return {

View File

@@ -15,7 +15,7 @@ export default class PerUserNotesChart extends Chart<typeof schema> {
protected async tickMajor(group: string): Promise<Partial<KVs<typeof schema>>> {
const [count] = await Promise.all([
Notes.count({ userId: group }),
Notes.countBy({ userId: group }),
]);
return {

View File

@@ -15,8 +15,8 @@ export default class UsersChart extends Chart<typeof schema> {
protected async tickMajor(): Promise<Partial<KVs<typeof schema>>> {
const [localCount, remoteCount] = await Promise.all([
Users.count({ host: null }),
Users.count({ host: Not(IsNull()) }),
Users.countBy({ host: IsNull() }),
Users.countBy({ host: Not(IsNull()) }),
]);
return {