2019-05-27 10:54:47 +03:00
|
|
|
import * as Bull from 'bull';
|
2021-05-08 12:56:21 +03:00
|
|
|
import { ObjectStorageJobData } from '@/queue/types';
|
2019-05-27 10:54:47 +03:00
|
|
|
import deleteFile from './delete-file';
|
2019-07-01 15:12:14 +03:00
|
|
|
import cleanRemoteFiles from './clean-remote-files';
|
2019-05-27 10:54:47 +03:00
|
|
|
|
|
|
|
const jobs = {
|
|
|
|
deleteFile,
|
2019-07-01 15:12:14 +03:00
|
|
|
cleanRemoteFiles,
|
2021-05-08 12:56:21 +03:00
|
|
|
} as Record<string, Bull.ProcessCallbackFunction<ObjectStorageJobData> | Bull.ProcessPromiseFunction<ObjectStorageJobData>>;
|
2019-05-27 10:54:47 +03:00
|
|
|
|
|
|
|
export default function(q: Bull.Queue) {
|
|
|
|
for (const [k, v] of Object.entries(jobs)) {
|
2021-05-08 12:56:21 +03:00
|
|
|
q.process(k, 16, v);
|
2019-05-27 10:54:47 +03:00
|
|
|
}
|
|
|
|
}
|