2019-02-05 04:50:14 -06:00
|
|
|
import deliver from './http/deliver';
|
|
|
|
import processInbox from './http/process-inbox';
|
2019-02-20 10:30:21 -06:00
|
|
|
import { deleteNotes } from './delete-notes';
|
|
|
|
import { deleteDriveFiles } from './delete-drive-files';
|
2019-02-05 04:50:14 -06:00
|
|
|
import { exportNotes } from './export-notes';
|
2019-02-06 05:56:48 -06:00
|
|
|
import { exportFollowing } from './export-following';
|
|
|
|
import { exportMute } from './export-mute';
|
|
|
|
import { exportBlocking } from './export-blocking';
|
2019-02-05 04:50:14 -06:00
|
|
|
import { queueLogger } from '../logger';
|
2018-03-31 05:55:00 -05:00
|
|
|
|
2018-06-18 00:28:43 -05:00
|
|
|
const handlers: any = {
|
2018-04-07 01:45:03 -05:00
|
|
|
deliver,
|
|
|
|
processInbox,
|
2019-02-20 10:30:21 -06:00
|
|
|
deleteNotes,
|
|
|
|
deleteDriveFiles,
|
2019-02-05 04:50:14 -06:00
|
|
|
exportNotes,
|
2019-02-06 05:56:48 -06:00
|
|
|
exportFollowing,
|
|
|
|
exportMute,
|
|
|
|
exportBlocking,
|
2018-03-31 05:55:00 -05:00
|
|
|
};
|
|
|
|
|
2018-06-18 00:28:43 -05:00
|
|
|
export default (job: any, done: any) => {
|
2018-04-07 01:45:03 -05:00
|
|
|
const handler = handlers[job.data.type];
|
|
|
|
|
|
|
|
if (handler) {
|
|
|
|
handler(job, done);
|
|
|
|
} else {
|
2019-02-03 03:16:57 -06:00
|
|
|
queueLogger.error(`Unknown job: ${job.data.type}`);
|
2018-04-07 01:45:03 -05:00
|
|
|
done();
|
|
|
|
}
|
|
|
|
};
|