mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 01:26:12 +02:00
fix: #13667, record to instances:lastSeen instead of domains:lastSeen
This commit is contained in:
@@ -522,7 +522,7 @@ ActivityPub.record = async ({ id, type, actor }) => {
|
||||
|
||||
await Promise.all([
|
||||
db.sortedSetAdd(`activities:datetime`, now, id),
|
||||
db.sortedSetAdd('domains:lastSeen', now, hostname),
|
||||
ActivityPub.instances.log(hostname),
|
||||
analytics.increment(['activities', `activities:byType:${type}`, `activities:byHost:${hostname}`]),
|
||||
]);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const nconf = require('nconf');
|
||||
const assert = require('assert');
|
||||
const nconf = require('nconf');
|
||||
|
||||
const db = require('../../src/database');
|
||||
const controllers = require('../../src/controllers');
|
||||
@@ -105,7 +105,7 @@ describe('Analytics', () => {
|
||||
|
||||
it('should increment the last seen time of that domain', async () => {
|
||||
const id = `https://example.org/activity/${utils.generateUUID()}`;
|
||||
const before = await db.sortedSetScore('domains:lastSeen', 'example.org');
|
||||
const before = await db.sortedSetScore('instances:lastSeen', 'example.org');
|
||||
await controllers.activitypub.postInbox({
|
||||
body: {
|
||||
id,
|
||||
@@ -118,7 +118,7 @@ describe('Analytics', () => {
|
||||
},
|
||||
}, { sendStatus: () => {} });
|
||||
|
||||
const after = await db.sortedSetScore('domains:lastSeen', 'example.org');
|
||||
const after = await db.sortedSetScore('instances:lastSeen', 'example.org');
|
||||
|
||||
assert(before && after);
|
||||
assert(before < after);
|
||||
|
||||
Reference in New Issue
Block a user