mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 17:25:35 +03:00
refactor: use separate queue for integrity checks
This commit is contained in:
@@ -69,7 +69,7 @@ describe('/admin/maintenance', () => {
|
|||||||
name: ManualJobName.IntegrityChecksumMismatch,
|
name: ManualJobName.IntegrityChecksumMismatch,
|
||||||
});
|
});
|
||||||
|
|
||||||
await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask);
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
||||||
|
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get('/admin/maintenance/integrity/summary')
|
.get('/admin/maintenance/integrity/summary')
|
||||||
@@ -93,7 +93,7 @@ describe('/admin/maintenance', () => {
|
|||||||
name: ManualJobName.IntegrityOrphanFiles,
|
name: ManualJobName.IntegrityOrphanFiles,
|
||||||
});
|
});
|
||||||
|
|
||||||
await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask);
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
||||||
|
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get('/admin/maintenance/integrity/summary')
|
.get('/admin/maintenance/integrity/summary')
|
||||||
@@ -117,7 +117,7 @@ describe('/admin/maintenance', () => {
|
|||||||
name: ManualJobName.IntegrityOrphanFilesRefresh,
|
name: ManualJobName.IntegrityOrphanFilesRefresh,
|
||||||
});
|
});
|
||||||
|
|
||||||
await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask);
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
||||||
|
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get('/admin/maintenance/integrity/summary')
|
.get('/admin/maintenance/integrity/summary')
|
||||||
@@ -139,7 +139,7 @@ describe('/admin/maintenance', () => {
|
|||||||
name: ManualJobName.IntegrityMissingFiles,
|
name: ManualJobName.IntegrityMissingFiles,
|
||||||
});
|
});
|
||||||
|
|
||||||
await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask);
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
||||||
|
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get('/admin/maintenance/integrity/summary')
|
.get('/admin/maintenance/integrity/summary')
|
||||||
@@ -160,7 +160,7 @@ describe('/admin/maintenance', () => {
|
|||||||
name: ManualJobName.IntegrityMissingFilesRefresh,
|
name: ManualJobName.IntegrityMissingFilesRefresh,
|
||||||
});
|
});
|
||||||
|
|
||||||
await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask);
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
||||||
|
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get('/admin/maintenance/integrity/summary')
|
.get('/admin/maintenance/integrity/summary')
|
||||||
@@ -183,7 +183,7 @@ describe('/admin/maintenance', () => {
|
|||||||
name: ManualJobName.IntegrityChecksumMismatch,
|
name: ManualJobName.IntegrityChecksumMismatch,
|
||||||
});
|
});
|
||||||
|
|
||||||
await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask);
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
||||||
|
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get('/admin/maintenance/integrity/summary')
|
.get('/admin/maintenance/integrity/summary')
|
||||||
@@ -203,7 +203,7 @@ describe('/admin/maintenance', () => {
|
|||||||
name: ManualJobName.IntegrityChecksumMismatchRefresh,
|
name: ManualJobName.IntegrityChecksumMismatchRefresh,
|
||||||
});
|
});
|
||||||
|
|
||||||
await utils.waitForQueueFinish(admin.accessToken, QueueName.BackgroundTask);
|
await utils.waitForQueueFinish(admin.accessToken, QueueName.IntegrityCheck);
|
||||||
|
|
||||||
const { status, body } = await request(app)
|
const { status, body } = await request(app)
|
||||||
.get('/admin/maintenance/integrity/summary')
|
.get('/admin/maintenance/integrity/summary')
|
||||||
|
|||||||
3
mobile/openapi/lib/model/queue_name.dart
generated
3
mobile/openapi/lib/model/queue_name.dart
generated
@@ -40,6 +40,7 @@ class QueueName {
|
|||||||
static const backupDatabase = QueueName._(r'backupDatabase');
|
static const backupDatabase = QueueName._(r'backupDatabase');
|
||||||
static const ocr = QueueName._(r'ocr');
|
static const ocr = QueueName._(r'ocr');
|
||||||
static const workflow = QueueName._(r'workflow');
|
static const workflow = QueueName._(r'workflow');
|
||||||
|
static const integrityCheck = QueueName._(r'integrityCheck');
|
||||||
|
|
||||||
/// List of all possible values in this [enum][QueueName].
|
/// List of all possible values in this [enum][QueueName].
|
||||||
static const values = <QueueName>[
|
static const values = <QueueName>[
|
||||||
@@ -60,6 +61,7 @@ class QueueName {
|
|||||||
backupDatabase,
|
backupDatabase,
|
||||||
ocr,
|
ocr,
|
||||||
workflow,
|
workflow,
|
||||||
|
integrityCheck,
|
||||||
];
|
];
|
||||||
|
|
||||||
static QueueName? fromJson(dynamic value) => QueueNameTypeTransformer().decode(value);
|
static QueueName? fromJson(dynamic value) => QueueNameTypeTransformer().decode(value);
|
||||||
@@ -115,6 +117,7 @@ class QueueNameTypeTransformer {
|
|||||||
case r'backupDatabase': return QueueName.backupDatabase;
|
case r'backupDatabase': return QueueName.backupDatabase;
|
||||||
case r'ocr': return QueueName.ocr;
|
case r'ocr': return QueueName.ocr;
|
||||||
case r'workflow': return QueueName.workflow;
|
case r'workflow': return QueueName.workflow;
|
||||||
|
case r'integrityCheck': return QueueName.integrityCheck;
|
||||||
default:
|
default:
|
||||||
if (!allowNull) {
|
if (!allowNull) {
|
||||||
throw ArgumentError('Unknown enum value to decode: $data');
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class QueuesResponseLegacyDto {
|
|||||||
required this.duplicateDetection,
|
required this.duplicateDetection,
|
||||||
required this.faceDetection,
|
required this.faceDetection,
|
||||||
required this.facialRecognition,
|
required this.facialRecognition,
|
||||||
|
required this.integrityCheck,
|
||||||
required this.library_,
|
required this.library_,
|
||||||
required this.metadataExtraction,
|
required this.metadataExtraction,
|
||||||
required this.migration,
|
required this.migration,
|
||||||
@@ -42,6 +43,8 @@ class QueuesResponseLegacyDto {
|
|||||||
|
|
||||||
QueueResponseLegacyDto facialRecognition;
|
QueueResponseLegacyDto facialRecognition;
|
||||||
|
|
||||||
|
QueueResponseLegacyDto integrityCheck;
|
||||||
|
|
||||||
QueueResponseLegacyDto library_;
|
QueueResponseLegacyDto library_;
|
||||||
|
|
||||||
QueueResponseLegacyDto metadataExtraction;
|
QueueResponseLegacyDto metadataExtraction;
|
||||||
@@ -73,6 +76,7 @@ class QueuesResponseLegacyDto {
|
|||||||
other.duplicateDetection == duplicateDetection &&
|
other.duplicateDetection == duplicateDetection &&
|
||||||
other.faceDetection == faceDetection &&
|
other.faceDetection == faceDetection &&
|
||||||
other.facialRecognition == facialRecognition &&
|
other.facialRecognition == facialRecognition &&
|
||||||
|
other.integrityCheck == integrityCheck &&
|
||||||
other.library_ == library_ &&
|
other.library_ == library_ &&
|
||||||
other.metadataExtraction == metadataExtraction &&
|
other.metadataExtraction == metadataExtraction &&
|
||||||
other.migration == migration &&
|
other.migration == migration &&
|
||||||
@@ -94,6 +98,7 @@ class QueuesResponseLegacyDto {
|
|||||||
(duplicateDetection.hashCode) +
|
(duplicateDetection.hashCode) +
|
||||||
(faceDetection.hashCode) +
|
(faceDetection.hashCode) +
|
||||||
(facialRecognition.hashCode) +
|
(facialRecognition.hashCode) +
|
||||||
|
(integrityCheck.hashCode) +
|
||||||
(library_.hashCode) +
|
(library_.hashCode) +
|
||||||
(metadataExtraction.hashCode) +
|
(metadataExtraction.hashCode) +
|
||||||
(migration.hashCode) +
|
(migration.hashCode) +
|
||||||
@@ -108,7 +113,7 @@ class QueuesResponseLegacyDto {
|
|||||||
(workflow.hashCode);
|
(workflow.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'QueuesResponseLegacyDto[backgroundTask=$backgroundTask, backupDatabase=$backupDatabase, duplicateDetection=$duplicateDetection, faceDetection=$faceDetection, facialRecognition=$facialRecognition, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, storageTemplateMigration=$storageTemplateMigration, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion, workflow=$workflow]';
|
String toString() => 'QueuesResponseLegacyDto[backgroundTask=$backgroundTask, backupDatabase=$backupDatabase, duplicateDetection=$duplicateDetection, faceDetection=$faceDetection, facialRecognition=$facialRecognition, integrityCheck=$integrityCheck, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, storageTemplateMigration=$storageTemplateMigration, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion, workflow=$workflow]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@@ -117,6 +122,7 @@ class QueuesResponseLegacyDto {
|
|||||||
json[r'duplicateDetection'] = this.duplicateDetection;
|
json[r'duplicateDetection'] = this.duplicateDetection;
|
||||||
json[r'faceDetection'] = this.faceDetection;
|
json[r'faceDetection'] = this.faceDetection;
|
||||||
json[r'facialRecognition'] = this.facialRecognition;
|
json[r'facialRecognition'] = this.facialRecognition;
|
||||||
|
json[r'integrityCheck'] = this.integrityCheck;
|
||||||
json[r'library'] = this.library_;
|
json[r'library'] = this.library_;
|
||||||
json[r'metadataExtraction'] = this.metadataExtraction;
|
json[r'metadataExtraction'] = this.metadataExtraction;
|
||||||
json[r'migration'] = this.migration;
|
json[r'migration'] = this.migration;
|
||||||
@@ -146,6 +152,7 @@ class QueuesResponseLegacyDto {
|
|||||||
duplicateDetection: QueueResponseLegacyDto.fromJson(json[r'duplicateDetection'])!,
|
duplicateDetection: QueueResponseLegacyDto.fromJson(json[r'duplicateDetection'])!,
|
||||||
faceDetection: QueueResponseLegacyDto.fromJson(json[r'faceDetection'])!,
|
faceDetection: QueueResponseLegacyDto.fromJson(json[r'faceDetection'])!,
|
||||||
facialRecognition: QueueResponseLegacyDto.fromJson(json[r'facialRecognition'])!,
|
facialRecognition: QueueResponseLegacyDto.fromJson(json[r'facialRecognition'])!,
|
||||||
|
integrityCheck: QueueResponseLegacyDto.fromJson(json[r'integrityCheck'])!,
|
||||||
library_: QueueResponseLegacyDto.fromJson(json[r'library'])!,
|
library_: QueueResponseLegacyDto.fromJson(json[r'library'])!,
|
||||||
metadataExtraction: QueueResponseLegacyDto.fromJson(json[r'metadataExtraction'])!,
|
metadataExtraction: QueueResponseLegacyDto.fromJson(json[r'metadataExtraction'])!,
|
||||||
migration: QueueResponseLegacyDto.fromJson(json[r'migration'])!,
|
migration: QueueResponseLegacyDto.fromJson(json[r'migration'])!,
|
||||||
@@ -210,6 +217,7 @@ class QueuesResponseLegacyDto {
|
|||||||
'duplicateDetection',
|
'duplicateDetection',
|
||||||
'faceDetection',
|
'faceDetection',
|
||||||
'facialRecognition',
|
'facialRecognition',
|
||||||
|
'integrityCheck',
|
||||||
'library',
|
'library',
|
||||||
'metadataExtraction',
|
'metadataExtraction',
|
||||||
'migration',
|
'migration',
|
||||||
|
|||||||
10
mobile/openapi/lib/model/system_config_job_dto.dart
generated
10
mobile/openapi/lib/model/system_config_job_dto.dart
generated
@@ -15,6 +15,7 @@ class SystemConfigJobDto {
|
|||||||
SystemConfigJobDto({
|
SystemConfigJobDto({
|
||||||
required this.backgroundTask,
|
required this.backgroundTask,
|
||||||
required this.faceDetection,
|
required this.faceDetection,
|
||||||
|
required this.integrityCheck,
|
||||||
required this.library_,
|
required this.library_,
|
||||||
required this.metadataExtraction,
|
required this.metadataExtraction,
|
||||||
required this.migration,
|
required this.migration,
|
||||||
@@ -32,6 +33,8 @@ class SystemConfigJobDto {
|
|||||||
|
|
||||||
JobSettingsDto faceDetection;
|
JobSettingsDto faceDetection;
|
||||||
|
|
||||||
|
JobSettingsDto integrityCheck;
|
||||||
|
|
||||||
JobSettingsDto library_;
|
JobSettingsDto library_;
|
||||||
|
|
||||||
JobSettingsDto metadataExtraction;
|
JobSettingsDto metadataExtraction;
|
||||||
@@ -58,6 +61,7 @@ class SystemConfigJobDto {
|
|||||||
bool operator ==(Object other) => identical(this, other) || other is SystemConfigJobDto &&
|
bool operator ==(Object other) => identical(this, other) || other is SystemConfigJobDto &&
|
||||||
other.backgroundTask == backgroundTask &&
|
other.backgroundTask == backgroundTask &&
|
||||||
other.faceDetection == faceDetection &&
|
other.faceDetection == faceDetection &&
|
||||||
|
other.integrityCheck == integrityCheck &&
|
||||||
other.library_ == library_ &&
|
other.library_ == library_ &&
|
||||||
other.metadataExtraction == metadataExtraction &&
|
other.metadataExtraction == metadataExtraction &&
|
||||||
other.migration == migration &&
|
other.migration == migration &&
|
||||||
@@ -75,6 +79,7 @@ class SystemConfigJobDto {
|
|||||||
// ignore: unnecessary_parenthesis
|
// ignore: unnecessary_parenthesis
|
||||||
(backgroundTask.hashCode) +
|
(backgroundTask.hashCode) +
|
||||||
(faceDetection.hashCode) +
|
(faceDetection.hashCode) +
|
||||||
|
(integrityCheck.hashCode) +
|
||||||
(library_.hashCode) +
|
(library_.hashCode) +
|
||||||
(metadataExtraction.hashCode) +
|
(metadataExtraction.hashCode) +
|
||||||
(migration.hashCode) +
|
(migration.hashCode) +
|
||||||
@@ -88,12 +93,13 @@ class SystemConfigJobDto {
|
|||||||
(workflow.hashCode);
|
(workflow.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'SystemConfigJobDto[backgroundTask=$backgroundTask, faceDetection=$faceDetection, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion, workflow=$workflow]';
|
String toString() => 'SystemConfigJobDto[backgroundTask=$backgroundTask, faceDetection=$faceDetection, integrityCheck=$integrityCheck, library_=$library_, metadataExtraction=$metadataExtraction, migration=$migration, notifications=$notifications, ocr=$ocr, search=$search, sidecar=$sidecar, smartSearch=$smartSearch, thumbnailGeneration=$thumbnailGeneration, videoConversion=$videoConversion, workflow=$workflow]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
json[r'backgroundTask'] = this.backgroundTask;
|
json[r'backgroundTask'] = this.backgroundTask;
|
||||||
json[r'faceDetection'] = this.faceDetection;
|
json[r'faceDetection'] = this.faceDetection;
|
||||||
|
json[r'integrityCheck'] = this.integrityCheck;
|
||||||
json[r'library'] = this.library_;
|
json[r'library'] = this.library_;
|
||||||
json[r'metadataExtraction'] = this.metadataExtraction;
|
json[r'metadataExtraction'] = this.metadataExtraction;
|
||||||
json[r'migration'] = this.migration;
|
json[r'migration'] = this.migration;
|
||||||
@@ -119,6 +125,7 @@ class SystemConfigJobDto {
|
|||||||
return SystemConfigJobDto(
|
return SystemConfigJobDto(
|
||||||
backgroundTask: JobSettingsDto.fromJson(json[r'backgroundTask'])!,
|
backgroundTask: JobSettingsDto.fromJson(json[r'backgroundTask'])!,
|
||||||
faceDetection: JobSettingsDto.fromJson(json[r'faceDetection'])!,
|
faceDetection: JobSettingsDto.fromJson(json[r'faceDetection'])!,
|
||||||
|
integrityCheck: JobSettingsDto.fromJson(json[r'integrityCheck'])!,
|
||||||
library_: JobSettingsDto.fromJson(json[r'library'])!,
|
library_: JobSettingsDto.fromJson(json[r'library'])!,
|
||||||
metadataExtraction: JobSettingsDto.fromJson(json[r'metadataExtraction'])!,
|
metadataExtraction: JobSettingsDto.fromJson(json[r'metadataExtraction'])!,
|
||||||
migration: JobSettingsDto.fromJson(json[r'migration'])!,
|
migration: JobSettingsDto.fromJson(json[r'migration'])!,
|
||||||
@@ -179,6 +186,7 @@ class SystemConfigJobDto {
|
|||||||
static const requiredKeys = <String>{
|
static const requiredKeys = <String>{
|
||||||
'backgroundTask',
|
'backgroundTask',
|
||||||
'faceDetection',
|
'faceDetection',
|
||||||
|
'integrityCheck',
|
||||||
'library',
|
'library',
|
||||||
'metadataExtraction',
|
'metadataExtraction',
|
||||||
'migration',
|
'migration',
|
||||||
|
|||||||
@@ -18903,7 +18903,8 @@
|
|||||||
"notifications",
|
"notifications",
|
||||||
"backupDatabase",
|
"backupDatabase",
|
||||||
"ocr",
|
"ocr",
|
||||||
"workflow"
|
"workflow",
|
||||||
|
"integrityCheck"
|
||||||
],
|
],
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
@@ -19016,6 +19017,9 @@
|
|||||||
"facialRecognition": {
|
"facialRecognition": {
|
||||||
"$ref": "#/components/schemas/QueueResponseLegacyDto"
|
"$ref": "#/components/schemas/QueueResponseLegacyDto"
|
||||||
},
|
},
|
||||||
|
"integrityCheck": {
|
||||||
|
"$ref": "#/components/schemas/QueueResponseLegacyDto"
|
||||||
|
},
|
||||||
"library": {
|
"library": {
|
||||||
"$ref": "#/components/schemas/QueueResponseLegacyDto"
|
"$ref": "#/components/schemas/QueueResponseLegacyDto"
|
||||||
},
|
},
|
||||||
@@ -19059,6 +19063,7 @@
|
|||||||
"duplicateDetection",
|
"duplicateDetection",
|
||||||
"faceDetection",
|
"faceDetection",
|
||||||
"facialRecognition",
|
"facialRecognition",
|
||||||
|
"integrityCheck",
|
||||||
"library",
|
"library",
|
||||||
"metadataExtraction",
|
"metadataExtraction",
|
||||||
"migration",
|
"migration",
|
||||||
@@ -21971,6 +21976,9 @@
|
|||||||
"faceDetection": {
|
"faceDetection": {
|
||||||
"$ref": "#/components/schemas/JobSettingsDto"
|
"$ref": "#/components/schemas/JobSettingsDto"
|
||||||
},
|
},
|
||||||
|
"integrityCheck": {
|
||||||
|
"$ref": "#/components/schemas/JobSettingsDto"
|
||||||
|
},
|
||||||
"library": {
|
"library": {
|
||||||
"$ref": "#/components/schemas/JobSettingsDto"
|
"$ref": "#/components/schemas/JobSettingsDto"
|
||||||
},
|
},
|
||||||
@@ -22008,6 +22016,7 @@
|
|||||||
"required": [
|
"required": [
|
||||||
"backgroundTask",
|
"backgroundTask",
|
||||||
"faceDetection",
|
"faceDetection",
|
||||||
|
"integrityCheck",
|
||||||
"library",
|
"library",
|
||||||
"metadataExtraction",
|
"metadataExtraction",
|
||||||
"migration",
|
"migration",
|
||||||
|
|||||||
@@ -746,6 +746,7 @@ export type QueuesResponseLegacyDto = {
|
|||||||
duplicateDetection: QueueResponseLegacyDto;
|
duplicateDetection: QueueResponseLegacyDto;
|
||||||
faceDetection: QueueResponseLegacyDto;
|
faceDetection: QueueResponseLegacyDto;
|
||||||
facialRecognition: QueueResponseLegacyDto;
|
facialRecognition: QueueResponseLegacyDto;
|
||||||
|
integrityCheck: QueueResponseLegacyDto;
|
||||||
library: QueueResponseLegacyDto;
|
library: QueueResponseLegacyDto;
|
||||||
metadataExtraction: QueueResponseLegacyDto;
|
metadataExtraction: QueueResponseLegacyDto;
|
||||||
migration: QueueResponseLegacyDto;
|
migration: QueueResponseLegacyDto;
|
||||||
@@ -1491,6 +1492,7 @@ export type JobSettingsDto = {
|
|||||||
export type SystemConfigJobDto = {
|
export type SystemConfigJobDto = {
|
||||||
backgroundTask: JobSettingsDto;
|
backgroundTask: JobSettingsDto;
|
||||||
faceDetection: JobSettingsDto;
|
faceDetection: JobSettingsDto;
|
||||||
|
integrityCheck: JobSettingsDto;
|
||||||
library: JobSettingsDto;
|
library: JobSettingsDto;
|
||||||
metadataExtraction: JobSettingsDto;
|
metadataExtraction: JobSettingsDto;
|
||||||
migration: JobSettingsDto;
|
migration: JobSettingsDto;
|
||||||
@@ -5506,7 +5508,8 @@ export enum QueueName {
|
|||||||
Notifications = "notifications",
|
Notifications = "notifications",
|
||||||
BackupDatabase = "backupDatabase",
|
BackupDatabase = "backupDatabase",
|
||||||
Ocr = "ocr",
|
Ocr = "ocr",
|
||||||
Workflow = "workflow"
|
Workflow = "workflow",
|
||||||
|
IntegrityCheck = "integrityCheck"
|
||||||
}
|
}
|
||||||
export enum QueueCommand {
|
export enum QueueCommand {
|
||||||
Start = "start",
|
Start = "start",
|
||||||
|
|||||||
@@ -268,6 +268,7 @@ export const defaults = Object.freeze<SystemConfig>({
|
|||||||
[QueueName.Notification]: { concurrency: 5 },
|
[QueueName.Notification]: { concurrency: 5 },
|
||||||
[QueueName.Ocr]: { concurrency: 1 },
|
[QueueName.Ocr]: { concurrency: 1 },
|
||||||
[QueueName.Workflow]: { concurrency: 5 },
|
[QueueName.Workflow]: { concurrency: 5 },
|
||||||
|
[QueueName.IntegrityCheck]: { concurrency: 1 },
|
||||||
},
|
},
|
||||||
logging: {
|
logging: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ export class QueuesResponseLegacyDto implements Record<QueueName, QueueResponseL
|
|||||||
|
|
||||||
@ApiProperty({ type: QueueResponseLegacyDto })
|
@ApiProperty({ type: QueueResponseLegacyDto })
|
||||||
[QueueName.Workflow]!: QueueResponseLegacyDto;
|
[QueueName.Workflow]!: QueueResponseLegacyDto;
|
||||||
|
|
||||||
|
@ApiProperty({ type: QueueResponseLegacyDto })
|
||||||
|
[QueueName.IntegrityCheck]!: QueueResponseLegacyDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const mapQueueLegacy = (response: QueueResponseDto): QueueResponseLegacyDto => {
|
export const mapQueueLegacy = (response: QueueResponseDto): QueueResponseLegacyDto => {
|
||||||
|
|||||||
@@ -267,6 +267,12 @@ class SystemConfigJobDto implements Record<ConcurrentQueueName, JobSettingsDto>
|
|||||||
@IsObject()
|
@IsObject()
|
||||||
@Type(() => JobSettingsDto)
|
@Type(() => JobSettingsDto)
|
||||||
[QueueName.Workflow]!: JobSettingsDto;
|
[QueueName.Workflow]!: JobSettingsDto;
|
||||||
|
|
||||||
|
@ApiProperty({ type: JobSettingsDto })
|
||||||
|
@ValidateNested()
|
||||||
|
@IsObject()
|
||||||
|
@Type(() => JobSettingsDto)
|
||||||
|
[QueueName.IntegrityCheck]!: JobSettingsDto;
|
||||||
}
|
}
|
||||||
|
|
||||||
class SystemConfigLibraryScanDto {
|
class SystemConfigLibraryScanDto {
|
||||||
|
|||||||
@@ -565,6 +565,7 @@ export enum QueueName {
|
|||||||
BackupDatabase = 'backupDatabase',
|
BackupDatabase = 'backupDatabase',
|
||||||
Ocr = 'ocr',
|
Ocr = 'ocr',
|
||||||
Workflow = 'workflow',
|
Workflow = 'workflow',
|
||||||
|
IntegrityCheck = 'integrityCheck',
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum QueueJobStatus {
|
export enum QueueJobStatus {
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ export class IntegrityService extends BaseService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityOrphanedFilesQueueAll, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityOrphanedFilesQueueAll, queue: QueueName.IntegrityCheck })
|
||||||
async handleOrphanedFilesQueueAll({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> {
|
async handleOrphanedFilesQueueAll({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> {
|
||||||
this.logger.log(`Checking for out of date orphaned file reports...`);
|
this.logger.log(`Checking for out of date orphaned file reports...`);
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityOrphanedFiles, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityOrphanedFiles, queue: QueueName.IntegrityCheck })
|
||||||
async handleOrphanedFiles({ type, paths }: IIntegrityOrphanedFilesJob): Promise<JobStatus> {
|
async handleOrphanedFiles({ type, paths }: IIntegrityOrphanedFilesJob): Promise<JobStatus> {
|
||||||
this.logger.log(`Processing batch of ${paths.length} files to check if they are orphaned.`);
|
this.logger.log(`Processing batch of ${paths.length} files to check if they are orphaned.`);
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityOrphanedFilesRefresh, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityOrphanedFilesRefresh, queue: QueueName.IntegrityCheck })
|
||||||
async handleOrphanedRefresh({ items }: IIntegrityPathWithReportJob): Promise<JobStatus> {
|
async handleOrphanedRefresh({ items }: IIntegrityPathWithReportJob): Promise<JobStatus> {
|
||||||
this.logger.log(`Processing batch of ${items.length} reports to check if they are out of date.`);
|
this.logger.log(`Processing batch of ${items.length} reports to check if they are out of date.`);
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityMissingFilesQueueAll, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityMissingFilesQueueAll, queue: QueueName.IntegrityCheck })
|
||||||
async handleMissingFilesQueueAll({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> {
|
async handleMissingFilesQueueAll({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> {
|
||||||
if (refreshOnly) {
|
if (refreshOnly) {
|
||||||
this.logger.log(`Checking for out of date missing file reports...`);
|
this.logger.log(`Checking for out of date missing file reports...`);
|
||||||
@@ -314,7 +314,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityMissingFiles, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityMissingFiles, queue: QueueName.IntegrityCheck })
|
||||||
async handleMissingFiles({ items }: IIntegrityMissingFilesJob): Promise<JobStatus> {
|
async handleMissingFiles({ items }: IIntegrityMissingFilesJob): Promise<JobStatus> {
|
||||||
this.logger.log(`Processing batch of ${items.length} files to check if they are missing.`);
|
this.logger.log(`Processing batch of ${items.length} files to check if they are missing.`);
|
||||||
|
|
||||||
@@ -350,7 +350,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityMissingFilesRefresh, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityMissingFilesRefresh, queue: QueueName.IntegrityCheck })
|
||||||
async handleMissingRefresh({ items: paths }: IIntegrityPathWithReportJob): Promise<JobStatus> {
|
async handleMissingRefresh({ items: paths }: IIntegrityPathWithReportJob): Promise<JobStatus> {
|
||||||
this.logger.log(`Processing batch of ${paths.length} reports to check if they are out of date.`);
|
this.logger.log(`Processing batch of ${paths.length} reports to check if they are out of date.`);
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityChecksumFiles, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityChecksumFiles, queue: QueueName.IntegrityCheck })
|
||||||
async handleChecksumFiles({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> {
|
async handleChecksumFiles({ refreshOnly }: IIntegrityJob = {}): Promise<JobStatus> {
|
||||||
if (refreshOnly) {
|
if (refreshOnly) {
|
||||||
this.logger.log(`Checking for out of date checksum file reports...`);
|
this.logger.log(`Checking for out of date checksum file reports...`);
|
||||||
@@ -507,7 +507,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityChecksumFilesRefresh, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityChecksumFilesRefresh, queue: QueueName.IntegrityCheck })
|
||||||
async handleChecksumRefresh({ items: paths }: IIntegrityPathWithChecksumJob): Promise<JobStatus> {
|
async handleChecksumRefresh({ items: paths }: IIntegrityPathWithChecksumJob): Promise<JobStatus> {
|
||||||
this.logger.log(`Processing batch of ${paths.length} reports to check if they are out of date.`);
|
this.logger.log(`Processing batch of ${paths.length} reports to check if they are out of date.`);
|
||||||
|
|
||||||
@@ -551,7 +551,7 @@ export class IntegrityService extends BaseService {
|
|||||||
return JobStatus.Success;
|
return JobStatus.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnJob({ name: JobName.IntegrityReportDelete, queue: QueueName.BackgroundTask })
|
@OnJob({ name: JobName.IntegrityReportDelete, queue: QueueName.IntegrityCheck })
|
||||||
async handleDeleteIntegrityReport({ type }: IIntegrityDeleteReportJob): Promise<JobStatus> {
|
async handleDeleteIntegrityReport({ type }: IIntegrityDeleteReportJob): Promise<JobStatus> {
|
||||||
this.logger.log(`Deleting all entries for ${type ?? 'all types of'} integrity report`);
|
this.logger.log(`Deleting all entries for ${type ?? 'all types of'} integrity report`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user