fix: nodeinfo
This commit is contained in:
parent
697361ca03
commit
fd4099a760
2 changed files with 16 additions and 1 deletions
|
@ -157,6 +157,16 @@ CREATE MATERIALIZED VIEW local_timeline AS
|
|||
PRIMARY KEY ("createdAtDate", "createdAt", "userId", "userHost", "visibility")
|
||||
WITH CLUSTERING ORDER BY ("createdAt" DESC);
|
||||
|
||||
CREATE MATERIALIZED VIEW local_note AS
|
||||
SELECT "createdAtDate", "createdAt", "userId", "userHost", "visibility" FROM note
|
||||
WHERE "createdAtDate" IS NOT NULL
|
||||
AND "createdAt" IS NOT NULL
|
||||
AND "userId" IS NOT NULL
|
||||
AND "userHost" = 'local'
|
||||
AND "visibility" IS NOT NULL
|
||||
PRIMARY KEY ("createdAtDate", "createdAt", "userId", "userHost", "visibility")
|
||||
WITH CLUSTERING ORDER BY ("createdAt" DESC);
|
||||
|
||||
CREATE MATERIALIZED VIEW score_feed AS
|
||||
SELECT * FROM note
|
||||
WHERE "createdAtDate" IS NOT NULL
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Users, Notes } from "@/models/index.js";
|
|||
import { IsNull, MoreThan } from "typeorm";
|
||||
import { MAX_NOTE_TEXT_LENGTH, MAX_CAPTION_TEXT_LENGTH } from "@/const.js";
|
||||
import { Cache } from "@/misc/cache.js";
|
||||
import { scyllaClient } from "@/db/scylla";
|
||||
|
||||
const router = new Router();
|
||||
|
||||
|
@ -41,7 +42,11 @@ const nodeinfo2 = async () => {
|
|||
lastActiveDate: MoreThan(new Date(now - 2592000000)),
|
||||
},
|
||||
}),
|
||||
Notes.count({ where: { userHost: IsNull() } }),
|
||||
scyllaClient
|
||||
? scyllaClient
|
||||
.execute("SELECT COUNT(1) FROM local_note")
|
||||
.then((result) => result.first().get("count") as number)
|
||||
: Notes.count({ where: { userHost: IsNull() } }),
|
||||
]);
|
||||
|
||||
const proxyAccount = meta.proxyAccountId
|
||||
|
|
Loading…
Reference in a new issue