mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-29 03:28:29 +01:00
chore: add note
This commit is contained in:
parent
21de5c4a9c
commit
0d05f05610
1 changed files with 2 additions and 0 deletions
|
@ -67,6 +67,7 @@ router.get('/notes/:note', async (ctx, next) => {
|
||||||
if (!isActivityPubReq(ctx)) return await next();
|
if (!isActivityPubReq(ctx)) return await next();
|
||||||
|
|
||||||
// TODO: typeorm 3.0にしたら .then(x => x || null) は消せる
|
// TODO: typeorm 3.0にしたら .then(x => x || null) は消せる
|
||||||
|
// nginxとかでキャッシュしてくれそうだからそもそもnode側でのキャッシュ不要かも?
|
||||||
const note = await noteCache.fetch(ctx.params.note, () => Notes.findOne({
|
const note = await noteCache.fetch(ctx.params.note, () => Notes.findOne({
|
||||||
id: ctx.params.note,
|
id: ctx.params.note,
|
||||||
visibility: In(['public' as const, 'home' as const]),
|
visibility: In(['public' as const, 'home' as const]),
|
||||||
|
@ -167,6 +168,7 @@ router.get('/users/:user', async (ctx, next) => {
|
||||||
const userId = ctx.params.user;
|
const userId = ctx.params.user;
|
||||||
|
|
||||||
// TODO: typeorm 3.0にしたら .then(x => x || null) は消せる
|
// TODO: typeorm 3.0にしたら .then(x => x || null) は消せる
|
||||||
|
// nginxとかでキャッシュしてくれそうだからそもそもnode側でのキャッシュ不要かも?
|
||||||
const user = await userCache.fetch(userId, () => Users.findOne({
|
const user = await userCache.fetch(userId, () => Users.findOne({
|
||||||
id: userId,
|
id: userId,
|
||||||
host: null,
|
host: null,
|
||||||
|
|
Loading…
Reference in a new issue