1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-07 20:36:48 +01:00
immich/server/libs/infra/src/infra.config.ts

39 lines
1.2 KiB
TypeScript
Raw Normal View History

2023-03-31 16:36:08 +02:00
import { QueueName } from '@app/domain';
import { BullModuleOptions } from '@nestjs/bull';
2023-03-31 16:36:08 +02:00
import { RedisOptions } from 'ioredis';
import { ConfigurationOptions } from 'typesense/lib/Typesense/Configuration';
2023-03-31 16:36:08 +02:00
export const redisConfig: RedisOptions = {
host: process.env.REDIS_HOSTNAME || 'immich_redis',
port: parseInt(process.env.REDIS_PORT || '6379'),
db: parseInt(process.env.REDIS_DBINDEX || '0'),
password: process.env.REDIS_PASSWORD || undefined,
path: process.env.REDIS_SOCKET || undefined,
};
export const bullConfig: BullModuleOptions = {
prefix: 'immich_bull',
2023-03-31 16:36:08 +02:00
redis: redisConfig,
defaultJobOptions: {
attempts: 3,
removeOnComplete: true,
removeOnFail: false,
},
};
export const bullQueues: BullModuleOptions[] = Object.values(QueueName).map((name) => ({ name }));
export const typesenseConfig: ConfigurationOptions = {
nodes: [
{
host: process.env.TYPESENSE_HOST || 'typesense',
port: Number(process.env.TYPESENSE_PORT) || 8108,
protocol: process.env.TYPESENSE_PROTOCOL || 'http',
},
],
apiKey: process.env.TYPESENSE_API_KEY as string,
numRetries: 15,
retryIntervalSeconds: 4,
connectionTimeoutSeconds: 10,
};