Sharkey/src/queue/processors/object-storage/index.ts

16 lines
466 B
TypeScript
Raw Normal View History

2019-05-27 10:54:47 +03:00
import * as Bull from 'bull';
import { ObjectStorageJobData } from '@/queue/types';
import deleteFile from './delete-file';
import cleanRemoteFiles from './clean-remote-files';
2019-05-27 10:54:47 +03:00
const jobs = {
deleteFile,
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
}
}