mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-12 05:54:00 +02:00
refactor: use TRANSIENT scope to avoid service bucket relay (#16985)
* refactor: use TRANSIENT scope to avoid service bucket relay * lint: fix lints * refactor: use transient for apResolver * Update packages/backend/src/core/activitypub/models/ApImageService.ts * fix
This commit is contained in:
@@ -3,28 +3,30 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { Inject, Injectable, Scope } from '@nestjs/common';
|
||||
import { NoteEntityService } from '@/core/entities/NoteEntityService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { RoleService } from '@/core/RoleService.js';
|
||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||
import type { JsonObject } from '@/misc/json-value.js';
|
||||
import Channel, { type MiChannelService } from '../channel.js';
|
||||
import Channel, { type ChannelRequest } from '../channel.js';
|
||||
import { REQUEST } from '@nestjs/core';
|
||||
|
||||
class RoleTimelineChannel extends Channel {
|
||||
@Injectable({ scope: Scope.TRANSIENT })
|
||||
export class RoleTimelineChannel extends Channel {
|
||||
public readonly chName = 'roleTimeline';
|
||||
public static shouldShare = false;
|
||||
public static requireCredential = false as const;
|
||||
private roleId: string;
|
||||
|
||||
constructor(
|
||||
@Inject(REQUEST)
|
||||
request: ChannelRequest,
|
||||
|
||||
private noteEntityService: NoteEntityService,
|
||||
private roleservice: RoleService,
|
||||
|
||||
id: string,
|
||||
connection: Channel['connection'],
|
||||
) {
|
||||
super(id, connection);
|
||||
super(request);
|
||||
//this.onNote = this.onNote.bind(this);
|
||||
}
|
||||
|
||||
@@ -60,26 +62,3 @@ class RoleTimelineChannel extends Channel {
|
||||
this.subscriber.off(`roleTimelineStream:${this.roleId}`, this.onEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class RoleTimelineChannelService implements MiChannelService<false> {
|
||||
public readonly shouldShare = RoleTimelineChannel.shouldShare;
|
||||
public readonly requireCredential = RoleTimelineChannel.requireCredential;
|
||||
public readonly kind = RoleTimelineChannel.kind;
|
||||
|
||||
constructor(
|
||||
private noteEntityService: NoteEntityService,
|
||||
private roleservice: RoleService,
|
||||
) {
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public create(id: string, connection: Channel['connection']): RoleTimelineChannel {
|
||||
return new RoleTimelineChannel(
|
||||
this.noteEntityService,
|
||||
this.roleservice,
|
||||
id,
|
||||
connection,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user