1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-21 18:16:55 +02:00

refactor(server): remove unused on method (#13830)

This commit is contained in:
Jason Rasmussen 2024-10-30 14:09:52 -04:00 committed by GitHub
parent 7961435d36
commit 40fbef50cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 5 deletions

View File

@ -88,7 +88,6 @@ export type EventItem<T extends EmitEvent> = {
export interface IEventRepository {
setup(options: { services: ClassConstructor<unknown>[] }): void;
on<T extends keyof EventMap>(item: EventItem<T>): void;
emit<T extends keyof EventMap>(event: T, ...args: ArgsOf<T>): Promise<void>;
/**

View File

@ -57,7 +57,6 @@ export class EventRepository implements OnGatewayConnection, OnGatewayDisconnect
setup({ services }: { services: ClassConstructor<unknown>[] }) {
const reflector = this.moduleRef.get(Reflector, { strict: false });
const repository = this.moduleRef.get<IEventRepository>(IEventRepository);
const items: Item<EmitEvent>[] = [];
// discovery
@ -94,7 +93,7 @@ export class EventRepository implements OnGatewayConnection, OnGatewayDisconnect
// register by priority
for (const handler of handlers) {
repository.on(handler);
this.addHandler(handler);
}
}
@ -134,7 +133,7 @@ export class EventRepository implements OnGatewayConnection, OnGatewayDisconnect
await client.leave(client.nsp.name);
}
on<T extends EmitEvent>(item: EventItem<T>): void {
private addHandler<T extends EmitEvent>(item: EventItem<T>): void {
const event = item.event;
if (!this.emitHandlers[event]) {

View File

@ -4,7 +4,6 @@ import { Mocked, vitest } from 'vitest';
export const newEventRepositoryMock = (): Mocked<IEventRepository> => {
return {
setup: vitest.fn(),
on: vitest.fn() as any,
emit: vitest.fn() as any,
clientSend: vitest.fn() as any,
clientBroadcast: vitest.fn() as any,