2019-03-07 15:07:21 +01:00
|
|
|
import * as Bull from 'bull';
|
2021-08-19 11:33:41 +02:00
|
|
|
import { DbJobData } from '@/queue/types.js';
|
|
|
|
import { deleteDriveFiles } from './delete-drive-files.js';
|
|
|
|
import { exportNotes } from './export-notes.js';
|
|
|
|
import { exportFollowing } from './export-following.js';
|
|
|
|
import { exportMute } from './export-mute.js';
|
|
|
|
import { exportBlocking } from './export-blocking.js';
|
|
|
|
import { exportUserLists } from './export-user-lists.js';
|
|
|
|
import { importFollowing } from './import-following.js';
|
|
|
|
import { importUserLists } from './import-user-lists.js';
|
2018-03-31 12:55:00 +02:00
|
|
|
|
2019-03-07 15:07:21 +01:00
|
|
|
const jobs = {
|
2019-02-20 17:30:21 +01:00
|
|
|
deleteDriveFiles,
|
2019-02-05 11:50:14 +01:00
|
|
|
exportNotes,
|
2019-02-06 12:56:48 +01:00
|
|
|
exportFollowing,
|
|
|
|
exportMute,
|
|
|
|
exportBlocking,
|
2019-03-11 11:43:58 +01:00
|
|
|
exportUserLists,
|
2019-03-11 16:34:19 +01:00
|
|
|
importFollowing,
|
2019-03-11 11:43:58 +01:00
|
|
|
importUserLists
|
2021-05-08 11:56:21 +02:00
|
|
|
} as Record<string, Bull.ProcessCallbackFunction<DbJobData> | Bull.ProcessPromiseFunction<DbJobData>>;
|
2018-03-31 12:55:00 +02:00
|
|
|
|
2021-05-08 11:56:21 +02:00
|
|
|
export default function(dbQueue: Bull.Queue<DbJobData>) {
|
2019-03-07 15:27:38 +01:00
|
|
|
for (const [k, v] of Object.entries(jobs)) {
|
2021-05-08 11:56:21 +02:00
|
|
|
dbQueue.process(k, v);
|
2019-03-07 15:27:38 +01:00
|
|
|
}
|
2019-03-07 15:07:21 +01:00
|
|
|
}
|