mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 15:58:50 +00:00
Merge commit 'f1a6f4333a75f5bc186334f7f43a26e969cd712d' into glitch-soc/merge-upstream
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"packageManager": "yarn@4.9.1",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
"node": ">=20"
|
||||
},
|
||||
"description": "Mastodon's Streaming Server",
|
||||
"private": true,
|
||||
|
||||
@@ -4,7 +4,6 @@ import { parseIntFromEnvValue } from './utils.js';
|
||||
|
||||
/**
|
||||
* @typedef RedisConfiguration
|
||||
* @property {string|undefined} namespace
|
||||
* @property {string|undefined} url
|
||||
* @property {import('ioredis').RedisOptions} options
|
||||
*/
|
||||
@@ -64,8 +63,6 @@ function getSentinelConfiguration(env, commonOptions) {
|
||||
* @returns {RedisConfiguration} configuration for the Redis connection
|
||||
*/
|
||||
export function configFromEnv(env) {
|
||||
const redisNamespace = env.REDIS_NAMESPACE;
|
||||
|
||||
// These options apply for both REDIS_URL based connections and connections
|
||||
// using the other REDIS_* environment variables:
|
||||
const commonOptions = {
|
||||
@@ -82,16 +79,14 @@ export function configFromEnv(env) {
|
||||
if (typeof env.REDIS_URL === 'string' && env.REDIS_URL.length > 0) {
|
||||
return {
|
||||
url: env.REDIS_URL,
|
||||
options: commonOptions,
|
||||
namespace: redisNamespace
|
||||
options: commonOptions
|
||||
};
|
||||
}
|
||||
|
||||
// If we have configuration for Redis Sentinel mode, prefer that:
|
||||
if (hasSentinelConfiguration(env)) {
|
||||
return {
|
||||
options: getSentinelConfiguration(env, commonOptions),
|
||||
namespace: redisNamespace
|
||||
options: getSentinelConfiguration(env, commonOptions)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -110,8 +105,7 @@ export function configFromEnv(env) {
|
||||
};
|
||||
|
||||
return {
|
||||
options,
|
||||
namespace: redisNamespace
|
||||
options
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user