Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save barisere/65f188ed97cc5937aa492dc7589f6e71 to your computer and use it in GitHub Desktop.
Save barisere/65f188ed97cc5937aa492dc7589f6e71 to your computer and use it in GitHub Desktop.
// 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