forked from mirrors/misskey
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:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user