33
packages/backend/src/queue/processors/db/index.ts
Normal file
33
packages/backend/src/queue/processors/db/index.ts
Normal file
@ -0,0 +1,33 @@
|
||||
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';
|
||||
import { deleteAccount } from './delete-account';
|
||||
import { importMuting } from './import-muting';
|
||||
import { importBlocking } from './import-blocking';
|
||||
|
||||
const jobs = {
|
||||
deleteDriveFiles,
|
||||
exportNotes,
|
||||
exportFollowing,
|
||||
exportMute,
|
||||
exportBlocking,
|
||||
exportUserLists,
|
||||
importFollowing,
|
||||
importMuting,
|
||||
importBlocking,
|
||||
importUserLists,
|
||||
deleteAccount,
|
||||
} 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user