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 { registerOrFetchInstanceDoc } from '../../services/register-or-fetch-ins
import { Instances, Users, UserPublickeys } from '../../models';
import { instanceChart } from '../../services/chart';
import { UserPublickey } from '../../models/entities/user-publickey';
import fetchMeta from '../../misc/fetch-meta';
import { fetchMeta } from '../../misc/fetch-meta';
import { toPuny } from '../../misc/convert-host';
import { validActor } from '../../remote/activitypub/type';
import { ensure } from '../../prelude/ensure';
@ -48,7 +48,6 @@ export default async (job: Bull.Job): Promise<void> => {
}
// ブロックしてたら中断
// TODO: いちいちデータベースにアクセスするのはコスト高そうなのでどっかにキャッシュしておく
const meta = await fetchMeta();
if (meta.blockedHosts.includes(host)) {
logger.info(`Blocked request: ${host}`);