Created
September 27, 2018 12:46
-
-
Save barisere/65f188ed97cc5937aa492dc7589f6e71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// undo-queue.js | |
"use strict"; | |
const crypto = require("crypto"); | |
const Queue = require("bull"); | |
const undoQueueWorkers = new Map(); | |
const { redis: redisConfig } = require("../config"); | |
const queue = new Queue("undoQueue", { | |
redis: { | |
host: redisConfig.host, | |
port: redisConfig.port, | |
password: redisConfig.password, | |
reconnectOnError: () => true, | |
enableOfflineQueue: true, | |
enableReadyCheck: true, | |
keyPrefix: "undoable", | |
connectTimeout: 20000, | |
db: redisConfig.undoQueueDB | |
}, | |
defaultJobOptions: { | |
delay: 10000, | |
attempts: 2, | |
backoff: { | |
delay: 2000, | |
type: "exponential" | |
}, | |
removeOnComplete: true, | |
removeOnFail: true | |
} | |
}); | |
// file continues... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment