fix DI for stream connection
This commit is contained in:
parent
d0bd12b410
commit
f67be0a733
2 changed files with 17 additions and 11 deletions
|
|
@ -8,9 +8,8 @@ import { Inject, Injectable } from '@nestjs/common';
|
|||
import * as Redis from 'ioredis';
|
||||
import * as WebSocket from 'ws';
|
||||
import proxyAddr from 'proxy-addr';
|
||||
import ms from 'ms';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import type { UsersRepository, MiAccessToken, MiUser } from '@/models/_.js';
|
||||
import type { UsersRepository, MiAccessToken, MiUser, NoteReactionsRepository, NotesRepository, NoteFavoritesRepository } from '@/models/_.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import type { Keyed, RateLimit } from '@/misc/rate-limit-utils.js';
|
||||
import { NotificationService } from '@/core/NotificationService.js';
|
||||
|
|
@ -22,6 +21,7 @@ import { ChannelFollowingService } from '@/core/ChannelFollowingService.js';
|
|||
import { getIpHash } from '@/misc/get-ip-hash.js';
|
||||
import { LoggerService } from '@/core/LoggerService.js';
|
||||
import { SkRateLimiterService } from '@/server/SkRateLimiterService.js';
|
||||
import { QueryService } from '@/core/QueryService.js';
|
||||
import { AuthenticateService, AuthenticationError } from './AuthenticateService.js';
|
||||
import MainStreamConnection from './stream/Connection.js';
|
||||
import { ChannelsService } from './stream/ChannelsService.js';
|
||||
|
|
@ -45,6 +45,16 @@ export class StreamingApiServerService {
|
|||
@Inject(DI.usersRepository)
|
||||
private usersRepository: UsersRepository,
|
||||
|
||||
@Inject(DI.noteReactionsRepository)
|
||||
private readonly noteReactionsRepository: NoteReactionsRepository,
|
||||
|
||||
@Inject(DI.notesRepository)
|
||||
private readonly notesRepository: NotesRepository,
|
||||
|
||||
@Inject(DI.noteFavoritesRepository)
|
||||
private readonly noteFavoritesRepository: NoteFavoritesRepository,
|
||||
|
||||
private readonly queryService: QueryService,
|
||||
private cacheService: CacheService,
|
||||
private authenticateService: AuthenticateService,
|
||||
private channelsService: ChannelsService,
|
||||
|
|
@ -168,6 +178,10 @@ export class StreamingApiServerService {
|
|||
};
|
||||
|
||||
const stream = new MainStreamConnection(
|
||||
this.noteReactionsRepository,
|
||||
this.notesRepository,
|
||||
this.noteFavoritesRepository,
|
||||
this.queryService,
|
||||
this.channelsService,
|
||||
this.notificationService,
|
||||
this.cacheService,
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ import { isJsonObject } from '@/misc/json-value.js';
|
|||
import type { JsonObject, JsonValue } from '@/misc/json-value.js';
|
||||
import { LoggerService } from '@/core/LoggerService.js';
|
||||
import type Logger from '@/logger.js';
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { QueryService } from '@/core/QueryService.js';
|
||||
import type { ChannelsService } from './ChannelsService.js';
|
||||
import type { EventEmitter } from 'events';
|
||||
|
|
@ -55,19 +53,13 @@ export default class Connection {
|
|||
private logger: Logger;
|
||||
|
||||
constructor(
|
||||
@Inject(DI.noteReactionsRepository)
|
||||
private readonly noteReactionsRepository: NoteReactionsRepository,
|
||||
|
||||
@Inject(DI.notesRepository)
|
||||
private readonly notesRepository: NotesRepository,
|
||||
|
||||
@Inject(DI.noteFavoritesRepository)
|
||||
private readonly noteFavoritesRepository: NoteFavoritesRepository,
|
||||
|
||||
private readonly queryService: QueryService,
|
||||
private channelsService: ChannelsService,
|
||||
private notificationService: NotificationService,
|
||||
public readonly cacheService: CacheService,
|
||||
private readonly queryService: QueryService,
|
||||
private channelFollowingService: ChannelFollowingService,
|
||||
loggerService: LoggerService,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue