28 lines
878 B
TypeScript
28 lines
878 B
TypeScript
import * as Bull from 'bull';
|
|
import { DbJobData } from '@/queue/types';
|
|
import { deleteDriveFiles } from './delete-drive-files';
|
|
import { exportNotes } from './export-notes';
|
|
import { exportFollowing } from './export-following';
|
|
import { exportMute } from './export-mute';
|
|
import { exportBlocking } from './export-blocking';
|
|
import { exportUserLists } from './export-user-lists';
|
|
import { importFollowing } from './import-following';
|
|
import { importUserLists } from './import-user-lists';
|
|
|
|
const jobs = {
|
|
deleteDriveFiles,
|
|
exportNotes,
|
|
exportFollowing,
|
|
exportMute,
|
|
exportBlocking,
|
|
exportUserLists,
|
|
importFollowing,
|
|
importUserLists
|
|
} as Record<string, Bull.ProcessCallbackFunction<DbJobData> | Bull.ProcessPromiseFunction<DbJobData>>;
|
|
|
|
export default function(dbQueue: Bull.Queue<DbJobData>) {
|
|
for (const [k, v] of Object.entries(jobs)) {
|
|
dbQueue.process(k, v);
|
|
}
|
|
}
|