summaryrefslogtreecommitdiff
path: root/src/queue/index.ts
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2019-02-06 22:44:55 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-02-06 22:44:55 +0900
commit96bc17aa1014983d5e6bf8b4c05d898156995a0d (patch)
treefdf7c68bdbf3784988351004127db988d7c40c29 /src/queue/index.ts
parentFix bug (diff)
downloadsharkey-96bc17aa1014983d5e6bf8b4c05d898156995a0d.tar.gz
sharkey-96bc17aa1014983d5e6bf8b4c05d898156995a0d.tar.bz2
sharkey-96bc17aa1014983d5e6bf8b4c05d898156995a0d.zip
Check config on load (#4170)
Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
Diffstat (limited to 'src/queue/index.ts')
-rw-r--r--src/queue/index.ts14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/queue/index.ts b/src/queue/index.ts
index 5d3baa8243..28768bf38f 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 != null;
+const queueAvailable = config.redis.isJust();
const queue = initializeQueue();
function initializeQueue() {
- if (queueAvailable) {
+ return config.redis.map(({ port, host, pass }) => {
return new Queue('misskey', {
redis: {
- port: config.redis.port,
- host: config.redis.host,
- password: config.redis.pass
+ port: port,
+ host: host,
+ password: pass.getOrElse(null)
},
removeOnSuccess: true,
@@ -27,9 +27,7 @@ function initializeQueue() {
sendEvents: false,
storeJobs: false
});
- } else {
- return null;
- }
+ }).getOrElse(null);
}
export function deliver(user: ILocalUser, content: any, to: any) {