mirror of
https://github.com/immich-app/immich.git
synced 2025-11-24 17:30:43 +09:00
feat(server): dynamic job concurrency (#2622)
* feat(server): dynamic job concurrency * styling and add setting info to top of the job list * regenerate api * remove DETECT_OBJECT job --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -15,7 +15,8 @@ import {
|
||||
ShareApi,
|
||||
SystemConfigApi,
|
||||
UserApi,
|
||||
UserApiFp
|
||||
UserApiFp,
|
||||
JobName
|
||||
} from './open-api';
|
||||
import { BASE_PATH } from './open-api/base';
|
||||
import { DUMMY_BASE_URL, toPathString } from './open-api/common';
|
||||
@@ -106,6 +107,23 @@ export class ImmichApi {
|
||||
const path = `/person/${personId}/thumbnail`;
|
||||
return this.createUrl(path);
|
||||
}
|
||||
|
||||
public getJobName(jobName: JobName) {
|
||||
const names: Record<JobName, string> = {
|
||||
[JobName.ThumbnailGeneration]: 'Generate Thumbnails',
|
||||
[JobName.MetadataExtraction]: 'Extract Metadata',
|
||||
[JobName.Sidecar]: 'Sidecar Metadata',
|
||||
[JobName.ObjectTagging]: 'Tag Objects',
|
||||
[JobName.ClipEncoding]: 'Encode Clip',
|
||||
[JobName.RecognizeFaces]: 'Recognize Faces',
|
||||
[JobName.VideoConversion]: 'Transcode Videos',
|
||||
[JobName.StorageTemplateMigration]: 'Storage Template Migration',
|
||||
[JobName.BackgroundTask]: 'Background Tasks',
|
||||
[JobName.Search]: 'Search'
|
||||
};
|
||||
|
||||
return names[jobName];
|
||||
}
|
||||
}
|
||||
|
||||
export const api = new ImmichApi({ basePath: '/api' });
|
||||
|
||||
126
web/src/api/open-api/api.ts
generated
126
web/src/api/open-api/api.ts
generated
@@ -296,61 +296,61 @@ export interface AllJobStatusResponseDto {
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'thumbnail-generation-queue': JobStatusDto;
|
||||
'thumbnailGeneration': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'metadata-extraction-queue': JobStatusDto;
|
||||
'metadataExtraction': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'video-conversion-queue': JobStatusDto;
|
||||
'videoConversion': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'object-tagging-queue': JobStatusDto;
|
||||
'objectTagging': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'clip-encoding-queue': JobStatusDto;
|
||||
'clipEncoding': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'storage-template-migration-queue': JobStatusDto;
|
||||
'storageTemplateMigration': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'background-task-queue': JobStatusDto;
|
||||
'backgroundTask': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'search-queue': JobStatusDto;
|
||||
'search': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'recognize-faces-queue': JobStatusDto;
|
||||
'recognizeFaces': JobStatusDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobStatusDto}
|
||||
* @memberof AllJobStatusResponseDto
|
||||
*/
|
||||
'sidecar-queue': JobStatusDto;
|
||||
'sidecar': JobStatusDto;
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -1486,21 +1486,34 @@ export interface JobCountsDto {
|
||||
*/
|
||||
|
||||
export const JobName = {
|
||||
ThumbnailGenerationQueue: 'thumbnail-generation-queue',
|
||||
MetadataExtractionQueue: 'metadata-extraction-queue',
|
||||
VideoConversionQueue: 'video-conversion-queue',
|
||||
ObjectTaggingQueue: 'object-tagging-queue',
|
||||
RecognizeFacesQueue: 'recognize-faces-queue',
|
||||
ClipEncodingQueue: 'clip-encoding-queue',
|
||||
BackgroundTaskQueue: 'background-task-queue',
|
||||
StorageTemplateMigrationQueue: 'storage-template-migration-queue',
|
||||
SearchQueue: 'search-queue',
|
||||
SidecarQueue: 'sidecar-queue'
|
||||
ThumbnailGeneration: 'thumbnailGeneration',
|
||||
MetadataExtraction: 'metadataExtraction',
|
||||
VideoConversion: 'videoConversion',
|
||||
ObjectTagging: 'objectTagging',
|
||||
RecognizeFaces: 'recognizeFaces',
|
||||
ClipEncoding: 'clipEncoding',
|
||||
BackgroundTask: 'backgroundTask',
|
||||
StorageTemplateMigration: 'storageTemplateMigration',
|
||||
Search: 'search',
|
||||
Sidecar: 'sidecar'
|
||||
} as const;
|
||||
|
||||
export type JobName = typeof JobName[keyof typeof JobName];
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface JobSettingsDto
|
||||
*/
|
||||
export interface JobSettingsDto {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof JobSettingsDto
|
||||
*/
|
||||
'concurrency': number;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@@ -2247,6 +2260,12 @@ export interface SystemConfigDto {
|
||||
* @memberof SystemConfigDto
|
||||
*/
|
||||
'storageTemplate': SystemConfigStorageTemplateDto;
|
||||
/**
|
||||
*
|
||||
* @type {SystemConfigJobDto}
|
||||
* @memberof SystemConfigDto
|
||||
*/
|
||||
'job': SystemConfigJobDto;
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -2319,6 +2338,73 @@ export const SystemConfigFFmpegDtoTranscodeEnum = {
|
||||
|
||||
export type SystemConfigFFmpegDtoTranscodeEnum = typeof SystemConfigFFmpegDtoTranscodeEnum[keyof typeof SystemConfigFFmpegDtoTranscodeEnum];
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface SystemConfigJobDto
|
||||
*/
|
||||
export interface SystemConfigJobDto {
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'thumbnailGeneration': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'metadataExtraction': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'videoConversion': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'objectTagging': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'clipEncoding': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'storageTemplateMigration': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'backgroundTask': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'search': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'recognizeFaces': JobSettingsDto;
|
||||
/**
|
||||
*
|
||||
* @type {JobSettingsDto}
|
||||
* @memberof SystemConfigJobDto
|
||||
*/
|
||||
'sidecar': JobSettingsDto;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
|
||||
Reference in New Issue
Block a user