This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
outline/server/utils/queue.js

20 lines
425 B
JavaScript

// @flow
import Redis from "ioredis";
import Queue from "bull";
import { client, subscriber } from "../redis";
export function createQueue(name: string) {
return new Queue(name, {
createClient(type) {
switch (type) {
case "client":
return client;
case "subscriber":
return subscriber;
default:
return new Redis(process.env.REDIS_URL);
}
},
});
}