mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(server): job repository (#1382)
* refactor(server): job repository * refactor: job repository * chore: generate open-api * fix: job panel * Remove incorrect subtitle Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -24,4 +24,5 @@ export enum JobName {
|
||||
OBJECT_DETECTION = 'detect-object',
|
||||
IMAGE_TAGGING = 'tag-image',
|
||||
DELETE_FILE_ON_DISK = 'delete-file-on-disk',
|
||||
CHECKSUM_GENERATION = 'checksum-generation',
|
||||
}
|
||||
|
||||
@@ -6,10 +6,19 @@ import {
|
||||
IVideoConversionProcessor,
|
||||
IReverseGeocodingProcessor,
|
||||
IUserDeletionJob,
|
||||
IVideoLengthExtractionProcessor,
|
||||
JpegGeneratorProcessor,
|
||||
WebpGeneratorProcessor,
|
||||
} from './interfaces';
|
||||
import { JobName } from './job.constants';
|
||||
import { JobName, QueueName } from './job.constants';
|
||||
|
||||
export interface JobCounts {
|
||||
active: number;
|
||||
completed: number;
|
||||
failed: number;
|
||||
delayed: number;
|
||||
waiting: number;
|
||||
}
|
||||
|
||||
export type JobItem =
|
||||
| { name: JobName.ASSET_UPLOADED; data: IAssetUploadedJob }
|
||||
@@ -21,6 +30,8 @@ export type JobItem =
|
||||
| { name: JobName.USER_DELETION; data: IUserDeletionJob }
|
||||
| { name: JobName.TEMPLATE_MIGRATION }
|
||||
| { name: JobName.CONFIG_CHANGE }
|
||||
| { name: JobName.CHECKSUM_GENERATION }
|
||||
| { name: JobName.EXTRACT_VIDEO_METADATA; data: IVideoLengthExtractionProcessor }
|
||||
| { name: JobName.OBJECT_DETECTION; data: IMachineLearningJob }
|
||||
| { name: JobName.IMAGE_TAGGING; data: IMachineLearningJob }
|
||||
| { name: JobName.DELETE_FILE_ON_DISK; data: IDeleteFileOnDiskJob };
|
||||
@@ -28,5 +39,8 @@ export type JobItem =
|
||||
export const IJobRepository = 'IJobRepository';
|
||||
|
||||
export interface IJobRepository {
|
||||
empty(name: QueueName): Promise<void>;
|
||||
add(item: JobItem): Promise<void>;
|
||||
isActive(name: QueueName): Promise<boolean>;
|
||||
getJobCounts(name: QueueName): Promise<JobCounts>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user