diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-03-11 19:43:58 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-03-11 19:43:58 +0900 |
| commit | c3d34bda37ca3b48214b094d54ee22d987a42574 (patch) | |
| tree | cc5c7bb9d1883563e83c3a0165b2c5e6380da9ba /src/queue/index.ts | |
| parent | 10.92.4 (diff) | |
| download | sharkey-c3d34bda37ca3b48214b094d54ee22d987a42574.tar.gz sharkey-c3d34bda37ca3b48214b094d54ee22d987a42574.tar.bz2 sharkey-c3d34bda37ca3b48214b094d54ee22d987a42574.zip | |
Resolve #4259
Diffstat (limited to 'src/queue/index.ts')
| -rw-r--r-- | src/queue/index.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/queue/index.ts b/src/queue/index.ts index 00a4a48f14..09e0ad59c9 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -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); |