2023-03-20 11:55:28 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
|
import { QueueName } from '../job.constants';
|
|
|
|
|
|
|
|
|
|
export class JobCountsDto {
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
active!: number;
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
completed!: number;
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
failed!: number;
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
delayed!: number;
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
waiting!: number;
|
2023-03-29 17:33:03 +02:00
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
paused!: number;
|
2023-03-20 11:55:28 -04:00
|
|
|
}
|
|
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
export class QueueStatusDto {
|
|
|
|
|
isActive!: boolean;
|
|
|
|
|
isPaused!: boolean;
|
|
|
|
|
}
|
2023-03-20 11:55:28 -04:00
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
export class JobStatusDto {
|
2023-03-20 11:55:28 -04:00
|
|
|
@ApiProperty({ type: JobCountsDto })
|
2023-04-01 22:46:07 +02:00
|
|
|
jobCounts!: JobCountsDto;
|
2023-03-20 11:55:28 -04:00
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
@ApiProperty({ type: QueueStatusDto })
|
|
|
|
|
queueStatus!: QueueStatusDto;
|
|
|
|
|
}
|
2023-03-20 11:55:28 -04:00
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
export class AllJobStatusResponseDto implements Record<QueueName, JobStatusDto> {
|
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.THUMBNAIL_GENERATION]!: JobStatusDto;
|
2023-03-20 11:55:28 -04:00
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.METADATA_EXTRACTION]!: JobStatusDto;
|
2023-03-20 11:55:28 -04:00
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.VIDEO_CONVERSION]!: JobStatusDto;
|
2023-03-20 11:55:28 -04:00
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.OBJECT_TAGGING]!: JobStatusDto;
|
2023-03-20 11:55:28 -04:00
|
|
|
|
2023-04-01 22:46:07 +02:00
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.CLIP_ENCODING]!: JobStatusDto;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.STORAGE_TEMPLATE_MIGRATION]!: JobStatusDto;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.BACKGROUND_TASK]!: JobStatusDto;
|
|
|
|
|
|
|
|
|
|
@ApiProperty({ type: JobStatusDto })
|
|
|
|
|
[QueueName.SEARCH]!: JobStatusDto;
|
2023-03-20 11:55:28 -04:00
|
|
|
}
|