diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-03-26 15:34:00 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-26 15:34:00 +0900 |
| commit | 1c67c26bd87aae64fe0f2ef45140e12a78564699 (patch) | |
| tree | 633a3fad1c5841ea20bc39d6b681b455bbdeabf3 /packages/backend/src/server/api/endpoints/stats.ts | |
| parent | .js (diff) | |
| download | sharkey-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/api/endpoints/stats.ts')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/stats.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/backend/src/server/api/endpoints/stats.ts b/packages/backend/src/server/api/endpoints/stats.ts index 92fea4de6a..f8a1ee29de 100644 --- a/packages/backend/src/server/api/endpoints/stats.ts +++ b/packages/backend/src/server/api/endpoints/stats.ts @@ -1,6 +1,7 @@ import define from '../define.js'; import { Instances, NoteReactions, Notes, Users } from '@/models/index.js'; import { } from '@/services/chart/index.js'; +import { IsNull } from 'typeorm'; export const meta = { requireCredential: false, @@ -61,11 +62,11 @@ export default define(meta, paramDef, async () => { instances, ] = await Promise.all([ Notes.count({ cache: 3600000 }), // 1 hour - Notes.count({ where: { userHost: null }, cache: 3600000 }), + Notes.count({ where: { userHost: IsNull() }, cache: 3600000 }), Users.count({ cache: 3600000 }), - Users.count({ where: { host: null }, cache: 3600000 }), + Users.count({ where: { host: IsNull() }, cache: 3600000 }), NoteReactions.count({ cache: 3600000 }), // 1 hour - //NoteReactions.count({ where: { userHost: null }, cache: 3600000 }), + //NoteReactions.count({ where: { userHost: IsNull() }, cache: 3600000 }), Instances.count({ cache: 3600000 }), ]); |