mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-12-08 04:09:07 +00:00
feat(server): turn off machine learning endpoint (#1361)
This commit is contained in:
@@ -9,6 +9,7 @@ import { GetJobDto, JobId } from './dto/get-job.dto';
|
||||
import { JobStatusResponseDto } from './response-dto/job-status-response.dto';
|
||||
import { IMachineLearningJob } from '@app/job/interfaces/machine-learning.interface';
|
||||
import { StorageService } from '@app/storage';
|
||||
import { MACHINE_LEARNING_ENABLED } from '@app/common';
|
||||
|
||||
@Injectable()
|
||||
export class JobService {
|
||||
@@ -161,6 +162,10 @@ export class JobService {
|
||||
}
|
||||
|
||||
private async runMachineLearningPipeline(): Promise<number> {
|
||||
if (!MACHINE_LEARNING_ENABLED) {
|
||||
throw new BadRequestException('Machine learning is not enabled.');
|
||||
}
|
||||
|
||||
const jobCount = await this.machineLearningQueue.getJobCounts();
|
||||
|
||||
if (jobCount.waiting > 0) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { SERVER_VERSION } from './constants/server_version.constant';
|
||||
import { RedisIoAdapter } from './middlewares/redis-io.adapter.middleware';
|
||||
import { json } from 'body-parser';
|
||||
import { patchOpenAPI } from './utils/patch-open-api.util';
|
||||
import { getLogLevels } from '@app/common';
|
||||
import { getLogLevels, MACHINE_LEARNING_ENABLED } from '@app/common';
|
||||
|
||||
const logger = new Logger('ImmichServer');
|
||||
|
||||
@@ -69,5 +69,7 @@ async function bootstrap() {
|
||||
const envName = (process.env.NODE_ENV || 'development').toUpperCase();
|
||||
logger.log(`Running Immich Server in ${envName} environment - version ${SERVER_VERSION}`);
|
||||
});
|
||||
|
||||
logger.warn(`Machine learning is ${MACHINE_LEARNING_ENABLED ? 'enabled' : 'disabled'}`);
|
||||
}
|
||||
bootstrap();
|
||||
|
||||
Reference in New Issue
Block a user