Resolve #4259
This commit is contained in:
parent
bb6ede2b8f
commit
c3d34bda37
6 changed files with 243 additions and 5 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue