MCPcopy
hub / github.com/immich-app/immich / runCommandLegacy

Method runCommandLegacy

server/src/services/queue.service.ts:109–143  ·  view source on GitHub ↗
(name: QueueName, dto: QueueCommandDto)

Source from the content-addressed store, hash-verified

107 }
108
109 async runCommandLegacy(name: QueueName, dto: QueueCommandDto): Promise<QueueResponseLegacyDto> {
110 this.logger.debug(`Handling command: queue=${name},command=${dto.command},force=${dto.force}`);
111
112 switch (dto.command) {
113 case QueueCommand.Start: {
114 await this.start(name, dto);
115 break;
116 }
117
118 case QueueCommand.Pause: {
119 await this.jobRepository.pause(name);
120 break;
121 }
122
123 case QueueCommand.Resume: {
124 await this.jobRepository.resume(name);
125 break;
126 }
127
128 case QueueCommand.Empty: {
129 await this.jobRepository.empty(name);
130 break;
131 }
132
133 case QueueCommand.ClearFailed: {
134 const failedJobs = await this.jobRepository.clear(name, QueueCleanType.Failed);
135 this.logger.debug(`Cleared failed jobs: ${failedJobs}`);
136 break;
137 }
138 }
139
140 const response = await this.getByName(name);
141
142 return mapQueueLegacy(response);
143 }
144
145 async getAll(_auth: AuthDto): Promise<QueueResponseDto[]> {
146 return Promise.all(Object.values(QueueName).map((name) => this.getByName(name)));

Callers 2

runQueueCommandLegacyMethod · 0.80

Calls 8

startMethod · 0.95
getByNameMethod · 0.95
mapQueueLegacyFunction · 0.90
debugMethod · 0.80
resumeMethod · 0.80
pauseMethod · 0.65
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected