feat: use pgvecto.rs (#3605)
This commit is contained in:
@@ -2,7 +2,6 @@ import { QueueName } from '@app/domain';
|
||||
import { RegisterQueueOptions } from '@nestjs/bullmq';
|
||||
import { QueueOptions } from 'bullmq';
|
||||
import { RedisOptions } from 'ioredis';
|
||||
import { ConfigurationOptions } from 'typesense/lib/Typesense/Configuration';
|
||||
|
||||
function parseRedisConfig(): RedisOptions {
|
||||
if (process.env.IMMICH_TEST_ENV == 'true') {
|
||||
@@ -41,36 +40,3 @@ export const bullConfig: QueueOptions = {
|
||||
};
|
||||
|
||||
export const bullQueues: RegisterQueueOptions[] = Object.values(QueueName).map((name) => ({ name }));
|
||||
|
||||
function parseTypeSenseConfig(): ConfigurationOptions {
|
||||
const typesenseURL = process.env.TYPESENSE_URL;
|
||||
const common = {
|
||||
apiKey: process.env.TYPESENSE_API_KEY as string,
|
||||
numRetries: 15,
|
||||
retryIntervalSeconds: 4,
|
||||
connectionTimeoutSeconds: 10,
|
||||
};
|
||||
if (typesenseURL && typesenseURL.startsWith('ha://')) {
|
||||
try {
|
||||
const decodedString = Buffer.from(typesenseURL.slice(5), 'base64').toString();
|
||||
return {
|
||||
nodes: JSON.parse(decodedString),
|
||||
...common,
|
||||
};
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to decode typesense options: ${error}`);
|
||||
}
|
||||
}
|
||||
return {
|
||||
nodes: [
|
||||
{
|
||||
host: process.env.TYPESENSE_HOST || 'typesense',
|
||||
port: Number(process.env.TYPESENSE_PORT) || 8108,
|
||||
protocol: process.env.TYPESENSE_PROTOCOL || 'http',
|
||||
},
|
||||
],
|
||||
...common,
|
||||
};
|
||||
}
|
||||
|
||||
export const typesenseConfig: ConfigurationOptions = parseTypeSenseConfig();
|
||||
|
||||
Reference in New Issue
Block a user