mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 17:24:56 +03:00
test: serialise the buffer over events
This commit is contained in:
@@ -221,7 +221,7 @@ describe('/admin/maintenance', () => {
|
||||
|
||||
// => enter maintenance mode
|
||||
|
||||
describe.skip.sequential('POST /', () => {
|
||||
describe.sequential('POST /', () => {
|
||||
it('should require authentication', async () => {
|
||||
const { status, body } = await request(app).post('/admin/maintenance').send({
|
||||
action: 'end',
|
||||
@@ -278,7 +278,7 @@ describe('/admin/maintenance', () => {
|
||||
|
||||
// => in maintenance mode
|
||||
|
||||
describe.skip.sequential('in maintenance mode', () => {
|
||||
describe.sequential('in maintenance mode', () => {
|
||||
describe('GET ~/server/config', async () => {
|
||||
it('should indicate we are in maintenance mode', async () => {
|
||||
const { status, body } = await request(app).get('/server/config');
|
||||
@@ -332,7 +332,7 @@ describe('/admin/maintenance', () => {
|
||||
|
||||
// => exit maintenance mode
|
||||
|
||||
describe.skip.sequential('POST /', () => {
|
||||
describe.sequential('POST /', () => {
|
||||
it('should exit maintenance mode', async () => {
|
||||
const { status } = await request(app).post('/admin/maintenance').set('cookie', cookie!).send({
|
||||
action: 'end',
|
||||
|
||||
12
mobile/openapi/lib/model/job_name.dart
generated
12
mobile/openapi/lib/model/job_name.dart
generated
@@ -80,10 +80,12 @@ class JobName {
|
||||
static const workflowRun = JobName._(r'WorkflowRun');
|
||||
static const integrityOrphanedFilesQueueAll = JobName._(r'IntegrityOrphanedFilesQueueAll');
|
||||
static const integrityOrphanedFiles = JobName._(r'IntegrityOrphanedFiles');
|
||||
static const integrityOrphanedCheckReports = JobName._(r'IntegrityOrphanedCheckReports');
|
||||
static const integrityOrphanedRefresh = JobName._(r'IntegrityOrphanedRefresh');
|
||||
static const integrityMissingFilesQueueAll = JobName._(r'IntegrityMissingFilesQueueAll');
|
||||
static const integrityMissingFiles = JobName._(r'IntegrityMissingFiles');
|
||||
static const integrityMissingFilesRefresh = JobName._(r'IntegrityMissingFilesRefresh');
|
||||
static const integrityChecksumFiles = JobName._(r'IntegrityChecksumFiles');
|
||||
static const integrityChecksumFilesRefresh = JobName._(r'IntegrityChecksumFilesRefresh');
|
||||
|
||||
/// List of all possible values in this [enum][JobName].
|
||||
static const values = <JobName>[
|
||||
@@ -144,10 +146,12 @@ class JobName {
|
||||
workflowRun,
|
||||
integrityOrphanedFilesQueueAll,
|
||||
integrityOrphanedFiles,
|
||||
integrityOrphanedCheckReports,
|
||||
integrityOrphanedRefresh,
|
||||
integrityMissingFilesQueueAll,
|
||||
integrityMissingFiles,
|
||||
integrityMissingFilesRefresh,
|
||||
integrityChecksumFiles,
|
||||
integrityChecksumFilesRefresh,
|
||||
];
|
||||
|
||||
static JobName? fromJson(dynamic value) => JobNameTypeTransformer().decode(value);
|
||||
@@ -243,10 +247,12 @@ class JobNameTypeTransformer {
|
||||
case r'WorkflowRun': return JobName.workflowRun;
|
||||
case r'IntegrityOrphanedFilesQueueAll': return JobName.integrityOrphanedFilesQueueAll;
|
||||
case r'IntegrityOrphanedFiles': return JobName.integrityOrphanedFiles;
|
||||
case r'IntegrityOrphanedCheckReports': return JobName.integrityOrphanedCheckReports;
|
||||
case r'IntegrityOrphanedRefresh': return JobName.integrityOrphanedRefresh;
|
||||
case r'IntegrityMissingFilesQueueAll': return JobName.integrityMissingFilesQueueAll;
|
||||
case r'IntegrityMissingFiles': return JobName.integrityMissingFiles;
|
||||
case r'IntegrityMissingFilesRefresh': return JobName.integrityMissingFilesRefresh;
|
||||
case r'IntegrityChecksumFiles': return JobName.integrityChecksumFiles;
|
||||
case r'IntegrityChecksumFilesRefresh': return JobName.integrityChecksumFilesRefresh;
|
||||
default:
|
||||
if (!allowNull) {
|
||||
throw ArgumentError('Unknown enum value to decode: $data');
|
||||
|
||||
@@ -16775,10 +16775,12 @@
|
||||
"WorkflowRun",
|
||||
"IntegrityOrphanedFilesQueueAll",
|
||||
"IntegrityOrphanedFiles",
|
||||
"IntegrityOrphanedCheckReports",
|
||||
"IntegrityOrphanedRefresh",
|
||||
"IntegrityMissingFilesQueueAll",
|
||||
"IntegrityMissingFiles",
|
||||
"IntegrityChecksumFiles"
|
||||
"IntegrityMissingFilesRefresh",
|
||||
"IntegrityChecksumFiles",
|
||||
"IntegrityChecksumFilesRefresh"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -5558,10 +5558,12 @@ export enum JobName {
|
||||
WorkflowRun = "WorkflowRun",
|
||||
IntegrityOrphanedFilesQueueAll = "IntegrityOrphanedFilesQueueAll",
|
||||
IntegrityOrphanedFiles = "IntegrityOrphanedFiles",
|
||||
IntegrityOrphanedCheckReports = "IntegrityOrphanedCheckReports",
|
||||
IntegrityOrphanedRefresh = "IntegrityOrphanedRefresh",
|
||||
IntegrityMissingFilesQueueAll = "IntegrityMissingFilesQueueAll",
|
||||
IntegrityMissingFiles = "IntegrityMissingFiles",
|
||||
IntegrityChecksumFiles = "IntegrityChecksumFiles"
|
||||
IntegrityMissingFilesRefresh = "IntegrityMissingFilesRefresh",
|
||||
IntegrityChecksumFiles = "IntegrityChecksumFiles",
|
||||
IntegrityChecksumFilesRefresh = "IntegrityChecksumFilesRefresh"
|
||||
}
|
||||
export enum SearchSuggestionType {
|
||||
Country = "country",
|
||||
|
||||
@@ -371,7 +371,11 @@ export class IntegrityService extends BaseService {
|
||||
await this.jobRepository.queue({
|
||||
name: JobName.IntegrityChecksumFilesRefresh,
|
||||
data: {
|
||||
items: batchReports,
|
||||
items: batchReports.map(({ path, reportId, checksum }) => ({
|
||||
path,
|
||||
reportId,
|
||||
checksum: checksum?.toString('hex'),
|
||||
})),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -505,7 +509,7 @@ export class IntegrityService extends BaseService {
|
||||
}),
|
||||
]);
|
||||
|
||||
if (checksum.equals(hash.digest())) {
|
||||
if (Buffer.from(checksum, 'hex').equals(hash.digest())) {
|
||||
return reportId;
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -296,7 +296,7 @@ export interface IIntegrityPathWithReportJob {
|
||||
}
|
||||
|
||||
export interface IIntegrityPathWithChecksumJob {
|
||||
items: { path: string; reportId: string | null; checksum?: Buffer | null }[];
|
||||
items: { path: string; reportId: string | null; checksum?: string | null }[];
|
||||
}
|
||||
|
||||
export interface JobCounts {
|
||||
|
||||
Reference in New Issue
Block a user