Initialize queue only if queue is enabled (#4125)

This commit is contained in:
Aya Morisawa 2019-02-04 16:41:53 +09:00 committed by syuilo
parent 88aad37860
commit 57423859f9

View file

@ -7,7 +7,11 @@ import { program } from '../argv';
const enableQueue = config.redis != null && !program.disableQueue;
const queue = new Queue('misskey', {
const queue = initializeQueue();
function initializeQueue() {
if (enableQueue) {
return new Queue('misskey', {
redis: {
port: config.redis.port,
host: config.redis.host,
@ -20,6 +24,10 @@ const queue = new Queue('misskey', {
sendEvents: false,
storeJobs: false
});
} else {
return null;
}
}
export function createHttpJob(data: any) {
if (enableQueue) {