mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: config repository (#15495)
* refactor: access repository * refactor: config repository
This commit is contained in:
parent
332a865ce6
commit
9a27a99cab
35 changed files with 150 additions and 171 deletions
|
|
@ -3,7 +3,7 @@ import { IoAdapter } from '@nestjs/platform-socket.io';
|
|||
import { createAdapter } from '@socket.io/redis-adapter';
|
||||
import { Redis } from 'ioredis';
|
||||
import { ServerOptions } from 'socket.io';
|
||||
import { IConfigRepository } from 'src/interfaces/config.interface';
|
||||
import { ConfigRepository } from 'src/repositories/config.repository';
|
||||
|
||||
export class WebSocketAdapter extends IoAdapter {
|
||||
constructor(private app: INestApplicationContext) {
|
||||
|
|
@ -11,7 +11,7 @@ export class WebSocketAdapter extends IoAdapter {
|
|||
}
|
||||
|
||||
createIOServer(port: number, options?: ServerOptions): any {
|
||||
const { redis } = this.app.get<IConfigRepository>(IConfigRepository).getEnv();
|
||||
const { redis } = this.app.get(ConfigRepository).getEnv();
|
||||
const server = super.createIOServer(port, options);
|
||||
const pubClient = new Redis(redis);
|
||||
const subClient = pubClient.duplicate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue