Cache meta

This commit is contained in:
syuilo 2019-04-24 08:11:19 +09:00
parent 8a55bdd89d
commit 5aa5896b22
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
34 changed files with 62 additions and 55 deletions

View file

@ -10,7 +10,7 @@ import { ILocalUser } from '../../models/entities/user';
import { publishApLogStream } from '../../services/stream';
import { apLogger } from './logger';
import { UserKeypairs } from '../../models';
import fetchMeta from '../../misc/fetch-meta';
import { fetchMeta } from '../../misc/fetch-meta';
import { toPuny } from '../../misc/convert-host';
import { ensure } from '../../prelude/ensure';
@ -24,7 +24,6 @@ export default async (user: ILocalUser, url: string, object: any) => {
const { protocol, host, hostname, port, pathname, search } = new URL(url);
// ブロックしてたら中断
// TODO: いちいちデータベースにアクセスするのはコスト高そうなのでどっかにキャッシュしておく
const meta = await fetchMeta();
if (meta.blockedHosts.includes(toPuny(host))) return;