mirror of
https://github.com/immich-app/immich.git
synced 2025-01-06 11:56:46 +01:00
fix(server): re-enable Redis unix socket support (#1494)
This commit is contained in:
parent
6a852332de
commit
d0f8d8d1f9
1 changed files with 7 additions and 2 deletions
|
@ -7,15 +7,20 @@ const redisHost = process.env.REDIS_HOSTNAME || 'immich_redis';
|
||||||
const redisPort = parseInt(process.env.REDIS_PORT || '6379');
|
const redisPort = parseInt(process.env.REDIS_PORT || '6379');
|
||||||
const redisDb = parseInt(process.env.REDIS_DBINDEX || '0');
|
const redisDb = parseInt(process.env.REDIS_DBINDEX || '0');
|
||||||
const redisPassword = process.env.REDIS_PASSWORD || undefined;
|
const redisPassword = process.env.REDIS_PASSWORD || undefined;
|
||||||
// const redisSocket = process.env.REDIS_SOCKET || undefined;
|
const redisSocket = process.env.REDIS_SOCKET || undefined;
|
||||||
|
|
||||||
export class RedisIoAdapter extends IoAdapter {
|
export class RedisIoAdapter extends IoAdapter {
|
||||||
private adapterConstructor: any;
|
private adapterConstructor: any;
|
||||||
|
|
||||||
async connectToRedis(): Promise<void> {
|
async connectToRedis(): Promise<void> {
|
||||||
const pubClient = createClient({
|
const pubClient = createClient({
|
||||||
url: `redis://${redisHost}:${redisPort}/${redisDb}`,
|
|
||||||
password: redisPassword,
|
password: redisPassword,
|
||||||
|
database: redisDb,
|
||||||
|
socket: {
|
||||||
|
host: redisHost,
|
||||||
|
port: redisPort,
|
||||||
|
path: redisSocket,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const subClient = pubClient.duplicate();
|
const subClient = pubClient.duplicate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue