summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/nodeinfo.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-03-26 15:34:00 +0900
committerGitHub <noreply@github.com>2022-03-26 15:34:00 +0900
commit1c67c26bd87aae64fe0f2ef45140e12a78564699 (patch)
tree633a3fad1c5841ea20bc39d6b681b455bbdeabf3 /packages/backend/src/server/nodeinfo.ts
parent.js (diff)
downloadsharkey-1c67c26bd87aae64fe0f2ef45140e12a78564699.tar.gz
sharkey-1c67c26bd87aae64fe0f2ef45140e12a78564699.tar.bz2
sharkey-1c67c26bd87aae64fe0f2ef45140e12a78564699.zip
refactor: migrate to typeorm 3.0 (#8443)
* wip * wip * wip * Update following.ts * wip * wip * wip * Update resolve-user.ts * maxQueryExecutionTime * wip * wip
Diffstat (limited to 'packages/backend/src/server/nodeinfo.ts')
-rw-r--r--packages/backend/src/server/nodeinfo.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/server/nodeinfo.ts b/packages/backend/src/server/nodeinfo.ts
index 2fc7b56cc2..13a362a75f 100644
--- a/packages/backend/src/server/nodeinfo.ts
+++ b/packages/backend/src/server/nodeinfo.ts
@@ -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;