Skip to content

Commit

Permalink
インスタンスモデレーションのキャッシュを自動処理でも即時反映するように
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Mar 21, 2021
1 parent cd97123 commit e1f1a1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/queue/processors/deliver.ts
Expand Up @@ -7,6 +7,7 @@ import Logger from '../../services/logger';
import { UpdateInstanceinfo } from '../../services/update-instanceinfo';
import { isBlockedHost, isClosedHost } from '../../misc/instance-info';
import { DeliverJobData } from '../type';
import { publishInstanceModUpdated } from '../../services/server-event';

const logger = new Logger('deliver');

Expand Down Expand Up @@ -79,7 +80,9 @@ export default async (job: Bull.Job<DeliverJobData>) => {
$set: {
isMarkedAsClosed: true
}
});
}).then(() => {
publishInstanceModUpdated();
})
});
}

Expand Down
5 changes: 4 additions & 1 deletion src/queue/processors/inbox.ts
Expand Up @@ -19,6 +19,7 @@ import { extractApHost } from '../../misc/convert-host';
import { LdSignature } from '../../remote/activitypub/misc/ld-signature';
import resolveUser from '../../remote/resolve-user';
import config from '../../config';
import { publishInstanceModUpdated } from '../../services/server-event';

const logger = new Logger('inbox');

Expand Down Expand Up @@ -139,7 +140,9 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {

Instance.update({ _id: i._id }, {
$set: set
});
}).then(() => {
publishInstanceModUpdated();
})

UpdateInstanceinfo(i, job.data.request);

Expand Down

0 comments on commit e1f1a1a

Please sign in to comment.