chore(server): introduce proper job status (#7932)

* introduce proper job status

* fix condition for onDone jobs

* fix tests
This commit is contained in:
Daniel Dietzler
2024-03-15 14:16:54 +01:00
committed by GitHub
parent 07e8f79563
commit a46366d336
19 changed files with 241 additions and 216 deletions
@@ -94,7 +94,13 @@ export type JobItem =
| { name: JobName.LIBRARY_QUEUE_SCAN_ALL; data: IBaseJob }
| { name: JobName.LIBRARY_QUEUE_CLEANUP; data: IBaseJob };
export type JobHandler<T = any> = (data: T) => boolean | Promise<boolean>;
export enum JobStatus {
SUCCESS = 'success',
FAILED = 'failed',
SKIPPED = 'skipped',
}
export type JobHandler<T = any> = (data: T) => Promise<JobStatus>;
export type JobItemHandler = (item: JobItem) => Promise<void>;
export const IJobRepository = 'IJobRepository';