Skip to content
Snippets Groups Projects
Commit 6cd41f98 authored by Aya Morisawa's avatar Aya Morisawa Committed by syuilo
Browse files

Initialize queue only if queue is enabled (#4125)

parent baf861ac
No related branches found
No related tags found
No related merge requests found
......@@ -7,19 +7,27 @@ import { program } from '../argv';
const enableQueue = config.redis != null && !program.disableQueue;
const queue = new Queue('misskey', {
redis: {
port: config.redis.port,
host: config.redis.host,
password: config.redis.pass
},
removeOnSuccess: true,
removeOnFailure: true,
getEvents: false,
sendEvents: false,
storeJobs: false
});
const queue = initializeQueue();
function initializeQueue() {
if (enableQueue) {
return new Queue('misskey', {
redis: {
port: config.redis.port,
host: config.redis.host,
password: config.redis.pass
},
removeOnSuccess: true,
removeOnFailure: true,
getEvents: false,
sendEvents: false,
storeJobs: false
});
} else {
return null;
}
}
export function createHttpJob(data: any) {
if (enableQueue) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment