mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-15 05:05:42 +01:00
Initialize queue only if queue is enabled (#4125)
This commit is contained in:
parent
baf861ac79
commit
6cd41f9860
1 changed files with 20 additions and 12 deletions
|
@ -7,7 +7,11 @@ import { program } from '../argv';
|
||||||
|
|
||||||
const enableQueue = config.redis != null && !program.disableQueue;
|
const enableQueue = config.redis != null && !program.disableQueue;
|
||||||
|
|
||||||
const queue = new Queue('misskey', {
|
const queue = initializeQueue();
|
||||||
|
|
||||||
|
function initializeQueue() {
|
||||||
|
if (enableQueue) {
|
||||||
|
return new Queue('misskey', {
|
||||||
redis: {
|
redis: {
|
||||||
port: config.redis.port,
|
port: config.redis.port,
|
||||||
host: config.redis.host,
|
host: config.redis.host,
|
||||||
|
@ -20,6 +24,10 @@ const queue = new Queue('misskey', {
|
||||||
sendEvents: false,
|
sendEvents: false,
|
||||||
storeJobs: false
|
storeJobs: false
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function createHttpJob(data: any) {
|
export function createHttpJob(data: any) {
|
||||||
if (enableQueue) {
|
if (enableQueue) {
|
||||||
|
|
Loading…
Reference in a new issue