refactor: enum casing (#19946)
This commit is contained in:
@@ -41,7 +41,7 @@ export class JobRepository {
|
||||
const instance = this.moduleRef.get<any>(Service);
|
||||
for (const methodName of getMethodNames(instance)) {
|
||||
const handler = instance[methodName];
|
||||
const config = reflector.get<JobConfig>(MetadataKey.JOB_CONFIG, handler);
|
||||
const config = reflector.get<JobConfig>(MetadataKey.JobConfig, handler);
|
||||
if (!config) {
|
||||
continue;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export class JobRepository {
|
||||
const item = this.handlers[name as JobName];
|
||||
if (!item) {
|
||||
this.logger.warn(`Skipping unknown job: "${name}"`);
|
||||
return JobStatus.SKIPPED;
|
||||
return JobStatus.Skipped;
|
||||
}
|
||||
|
||||
return item.handler(data);
|
||||
@@ -205,20 +205,20 @@ export class JobRepository {
|
||||
|
||||
private getJobOptions(item: JobItem): JobsOptions | null {
|
||||
switch (item.name) {
|
||||
case JobName.NOTIFY_ALBUM_UPDATE: {
|
||||
case JobName.NotifyAlbumUpdate: {
|
||||
return {
|
||||
jobId: `${item.data.id}/${item.data.recipientId}`,
|
||||
delay: item.data?.delay,
|
||||
};
|
||||
}
|
||||
case JobName.STORAGE_TEMPLATE_MIGRATION_SINGLE: {
|
||||
case JobName.StorageTemplateMigrationSingle: {
|
||||
return { jobId: item.data.id };
|
||||
}
|
||||
case JobName.GENERATE_PERSON_THUMBNAIL: {
|
||||
case JobName.GeneratePersonThumbnail: {
|
||||
return { priority: 1 };
|
||||
}
|
||||
case JobName.QUEUE_FACIAL_RECOGNITION: {
|
||||
return { jobId: JobName.QUEUE_FACIAL_RECOGNITION };
|
||||
case JobName.QueueFacialRecognition: {
|
||||
return { jobId: JobName.QueueFacialRecognition };
|
||||
}
|
||||
default: {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user