This repository was archived by the owner on Nov 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import * as Sentry from "@sentry/node";
66import { Integrations } from "@sentry/tracing" ;
77import debug from "debug" ;
88import { MongoClient } from "mongodb" ;
9- import { createCluster } from "redis" ;
9+ import { createClient } from "redis" ;
1010
1111import calculatePresenceUsage from "./util/calculatePresenceUsage.js" ;
1212import updateScience from "./util/updateScience.js" ;
@@ -23,14 +23,8 @@ Sentry.init({
2323 integrations : [ new Integrations . Mongo ( ) ]
2424} ) ;
2525
26- export const redis = createCluster ( {
27- rootNodes : process . env . REDIS_URL ?. split ( "," ) ?. map ( url => ( {
28- url
29- } ) ) || [
30- {
31- url : "redis://localhost:6379"
32- }
33- ]
26+ export const redis = createClient ( {
27+ url : process . env . REDIS_URL || "redis://localhost:6379"
3428 } ) ,
3529 mongo = new MongoClient ( process . env . MONGO_URL ! , {
3630 appName : "PreMiD-API-Master"
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
1212import { ApolloServer } from "apollo-server-fastify" ;
1313import responseCachePlugin from "apollo-server-plugin-response-cache" ;
1414import fastify , { FastifyContext , FastifyReply , FastifyRequest } from "fastify" ;
15- import { createCluster } from "redis" ;
15+ import { createClient , createCluster } from "redis" ;
1616import { MongoClient } from "mongodb" ;
1717
1818import appUpdate from "./generic/appUpdate" ;
@@ -43,15 +43,8 @@ if (process.env.SENTRY_DSN)
4343export const mongodb = new MongoClient ( process . env . MONGO_URL ! , {
4444 appName : "PreMiD-API-Worker"
4545 } ) ,
46- redis = createCluster ( {
47- rootNodes : process . env . REDIS_URL ?. split ( "," ) ?. map ( url => ( {
48- url
49- } ) ) || [
50- {
51- url : "redis://localhost:6379"
52- }
53- ] ,
54- useReplicas : false
46+ redis = createClient ( {
47+ url : process . env . REDIS_URL || "redis://localhost:6379"
5548 } ) ,
5649 baseRedisCache = new BaseRedisCache ( {
5750 //@ts -ignore
You can’t perform that action at this time.
0 commit comments