From 5448c22031d66cc020323bf4c4d1701889a46485 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 7 Feb 2019 21:02:33 +0900 Subject: Revert 96bc17aa1014983d5e6bf8b4c05d898156995a0d --- src/queue/index.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/queue') diff --git a/src/queue/index.ts b/src/queue/index.ts index 28768bf38f..5d3baa8243 100644 --- a/src/queue/index.ts +++ b/src/queue/index.ts @@ -8,17 +8,17 @@ import handler from './processors'; import { queueLogger } from './logger'; const enableQueue = !program.disableQueue; -const queueAvailable = config.redis.isJust(); +const queueAvailable = config.redis != null; const queue = initializeQueue(); function initializeQueue() { - return config.redis.map(({ port, host, pass }) => { + if (queueAvailable) { return new Queue('misskey', { redis: { - port: port, - host: host, - password: pass.getOrElse(null) + port: config.redis.port, + host: config.redis.host, + password: config.redis.pass }, removeOnSuccess: true, @@ -27,7 +27,9 @@ function initializeQueue() { sendEvents: false, storeJobs: false }); - }).getOrElse(null); + } else { + return null; + } } export function deliver(user: ILocalUser, content: any, to: any) { -- cgit v1.2.3-freya