diff options
| author | anatawa12 <anatawa12@icloud.com> | 2025-12-22 17:01:10 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-22 17:01:10 +0900 |
| commit | 74e847a04d1b287f50a10f7c1e44a4e7bc2f91ac (patch) | |
| tree | f50e8a73312f2e01262d66c4d034ad5c0df52304 /packages/backend/src/server/api/stream/channels/drive.ts | |
| parent | feat: use tsgo where capable (#16984) (diff) | |
| download | misskey-74e847a04d1b287f50a10f7c1e44a4e7bc2f91ac.tar.gz misskey-74e847a04d1b287f50a10f7c1e44a4e7bc2f91ac.tar.bz2 misskey-74e847a04d1b287f50a10f7c1e44a4e7bc2f91ac.zip | |
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
Diffstat (limited to 'packages/backend/src/server/api/stream/channels/drive.ts')
| -rw-r--r-- | packages/backend/src/server/api/stream/channels/drive.ts | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/packages/backend/src/server/api/stream/channels/drive.ts b/packages/backend/src/server/api/stream/channels/drive.ts index 03768f3d23..6f2eb2c8f9 100644 --- a/packages/backend/src/server/api/stream/channels/drive.ts +++ b/packages/backend/src/server/api/stream/channels/drive.ts @@ -3,17 +3,26 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { Injectable } from '@nestjs/common'; +import { Inject, Injectable, Scope } from '@nestjs/common'; import { bindThis } from '@/decorators.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 DriveChannel extends Channel { +@Injectable({ scope: Scope.TRANSIENT }) +export class DriveChannel extends Channel { public readonly chName = 'drive'; public static shouldShare = true; public static requireCredential = true as const; public static kind = 'read:account'; + constructor( + @Inject(REQUEST) + request: ChannelRequest, + ) { + super(request); + } + @bindThis public async init(params: JsonObject) { // Subscribe drive stream @@ -22,22 +31,3 @@ class DriveChannel extends Channel { }); } } - -@Injectable() -export class DriveChannelService implements MiChannelService<true> { - public readonly shouldShare = DriveChannel.shouldShare; - public readonly requireCredential = DriveChannel.requireCredential; - public readonly kind = DriveChannel.kind; - - constructor( - ) { - } - - @bindThis - public create(id: string, connection: Channel['connection']): DriveChannel { - return new DriveChannel( - id, - connection, - ); - } -} |