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:
parent
41c87074e6
commit
1c67c26bd8
325 changed files with 1314 additions and 1494 deletions
|
|
@ -2,7 +2,7 @@ import Router from '@koa/router';
|
|||
import config from '@/config/index.js';
|
||||
import { fetchMeta } from '@/misc/fetch-meta.js';
|
||||
import { Users, Notes } from '@/models/index.js';
|
||||
import { MoreThan } from 'typeorm';
|
||||
import { IsNull, MoreThan } from 'typeorm';
|
||||
import { MAX_NOTE_TEXT_LENGTH } from '@/const.js';
|
||||
import { Cache } from '@/misc/cache.js';
|
||||
|
||||
|
|
@ -29,10 +29,10 @@ const nodeinfo2 = async () => {
|
|||
localPosts,
|
||||
] = await Promise.all([
|
||||
fetchMeta(true),
|
||||
Users.count({ where: { host: null } }),
|
||||
Users.count({ where: { host: null, lastActiveDate: MoreThan(new Date(now - 15552000000)) } }),
|
||||
Users.count({ where: { host: null, lastActiveDate: MoreThan(new Date(now - 2592000000)) } }),
|
||||
Notes.count({ where: { userHost: null } }),
|
||||
Users.count({ where: { host: IsNull() } }),
|
||||
Users.count({ where: { host: IsNull(), lastActiveDate: MoreThan(new Date(now - 15552000000)) } }),
|
||||
Users.count({ where: { host: IsNull(), lastActiveDate: MoreThan(new Date(now - 2592000000)) } }),
|
||||
Notes.count({ where: { userHost: IsNull() } }),
|
||||
]);
|
||||
|
||||
const proxyAccount = meta.proxyAccountId ? await Users.pack(meta.proxyAccountId).catch(() => null) : null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue