Files
immich/server/libs/common/src/constants/index.ts
2023-03-21 21:49:19 -05:00

11 lines
409 B
TypeScript

import { BadRequestException } from '@nestjs/common';
export const MACHINE_LEARNING_URL = process.env.IMMICH_MACHINE_LEARNING_URL || 'http://immich-machine-learning:3003';
export const MACHINE_LEARNING_ENABLED = MACHINE_LEARNING_URL !== 'false';
export function assertMachineLearningEnabled() {
if (!MACHINE_LEARNING_ENABLED) {
throw new BadRequestException('Machine learning is not enabled.');
}
}