From 7275bc6d3b356f3aa8ff7aef92f5abf52a18a13e Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 7 Feb 2019 16:05:29 +0900 Subject: Improve instance stats --- src/queue/processors/http/process-inbox.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/queue/processors/http/process-inbox.ts') diff --git a/src/queue/processors/http/process-inbox.ts b/src/queue/processors/http/process-inbox.ts index 3cc13cbdaa..d88f00a098 100644 --- a/src/queue/processors/http/process-inbox.ts +++ b/src/queue/processors/http/process-inbox.ts @@ -8,6 +8,8 @@ import { toUnicode } from 'punycode'; import { URL } from 'url'; import { publishApLogStream } from '../../../services/stream'; import Logger from '../../../misc/logger'; +import { registerOrFetchInstanceDoc } from '../../../services/register-or-fetch-instance-doc'; +import Instance from '../../../models/instance'; const logger = new Logger('inbox'); @@ -101,6 +103,15 @@ export default async (job: bq.Job, done: any): Promise => { }); //#endregion + // Update stats + registerOrFetchInstanceDoc(user.host).then(i => { + Instance.update({ _id: i._id }, { + $set: { + latestRequestReceivedAt: new Date() + } + }); + }); + // アクティビティを処理 try { await perform(user, activity); -- cgit v1.2.3-freya