1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00

Fixed incorrect microservices URLs after updating dockerfiles (#159)

This commit is contained in:
Alex 2022-05-11 06:18:11 -05:00 committed by GitHub
parent bb89fa4aab
commit c5adbea6e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 15 deletions

View file

@ -5,7 +5,7 @@ import { ImageClassifierService } from './image-classifier.service';
export class ImageClassifierController { export class ImageClassifierController {
constructor( constructor(
private readonly imageClassifierService: ImageClassifierService, private readonly imageClassifierService: ImageClassifierService,
) {} ) { }
@Post('/tagImage') @Post('/tagImage')
async tagImage(@Body('thumbnailPath') thumbnailPath: string) { async tagImage(@Body('thumbnailPath') thumbnailPath: string) {

View file

@ -1,11 +1,12 @@
import { Body, Controller, Post } from '@nestjs/common'; import { Body, Controller, Post } from '@nestjs/common';
import { ObjectDetectionService } from './object-detection.service'; import { ObjectDetectionService } from './object-detection.service';
import { Logger } from '@nestjs/common';
@Controller('object-detection') @Controller('object-detection')
export class ObjectDetectionController { export class ObjectDetectionController {
constructor( constructor(
private readonly objectDetectionService: ObjectDetectionService, private readonly objectDetectionService: ObjectDetectionService,
) {} ) { }
@Post('/detectObject') @Post('/detectObject')
async detectObject(@Body('thumbnailPath') thumbnailPath: string) { async detectObject(@Body('thumbnailPath') thumbnailPath: string) {

View file

@ -115,7 +115,7 @@ export class BackgroundTaskProcessor {
async tagImage(job) { async tagImage(job) {
const { thumbnailPath, asset }: { thumbnailPath: string; asset: AssetEntity } = job.data; const { thumbnailPath, asset }: { thumbnailPath: string; asset: AssetEntity } = job.data;
const res = await axios.post('http://immich_microservices:3001/image-classifier/tagImage', { const res = await axios.post('http://immich-microservices:3001/image-classifier/tagImage', {
thumbnailPath: thumbnailPath, thumbnailPath: thumbnailPath,
}); });
@ -132,9 +132,10 @@ export class BackgroundTaskProcessor {
@Process('detect-object') @Process('detect-object')
async detectObject(job) { async detectObject(job) {
try {
const { thumbnailPath, asset }: { thumbnailPath: string; asset: AssetEntity } = job.data; const { thumbnailPath, asset }: { thumbnailPath: string; asset: AssetEntity } = job.data;
const res = await axios.post('http://immich_microservices:3001/object-detection/detectObject', { const res = await axios.post('http://immich-microservices:3001/object-detection/detectObject', {
thumbnailPath: thumbnailPath, thumbnailPath: thumbnailPath,
}); });
@ -146,5 +147,9 @@ export class BackgroundTaskProcessor {
conflictPaths: ['assetId'], conflictPaths: ['assetId'],
}); });
} }
} catch (error) {
Logger.error(`Failed to trigger object detection pipe line ${error.toString()}`)
}
} }
} }

View file

@ -9,7 +9,7 @@ export class BackgroundTaskService {
constructor( constructor(
@InjectQueue('background-task') @InjectQueue('background-task')
private backgroundTaskQueue: Queue, private backgroundTaskQueue: Queue,
) {} ) { }
async extractExif(savedAsset: AssetEntity, fileName: string, fileSize: number) { async extractExif(savedAsset: AssetEntity, fileName: string, fileSize: number) {
await this.backgroundTaskQueue.add( await this.backgroundTaskQueue.add(