This commit is contained in:
syuilo
2019-03-11 19:43:58 +09:00
parent bb6ede2b8f
commit c3d34bda37
6 changed files with 243 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import processDeliver from './processors/deliver';
import processInbox from './processors/inbox';
import processDb from './processors/db';
import { queueLogger } from './logger';
import { IDriveFile } from '../models/drive-file';
function initializeQueue(name: string) {
return new Queue(name, config.redis != null ? {
@ -145,6 +146,16 @@ export function createExportUserListsJob(user: ILocalUser) {
});
}
export function createImportUserListsJob(user: ILocalUser, fileId: IDriveFile['_id']) {
return dbQueue.add('importUserLists', {
user: user,
fileId: fileId
}, {
removeOnComplete: true,
removeOnFail: true
});
}
export default function() {
if (!program.onlyServer) {
deliverQueue.process(128, processDeliver);