Skip to content

Commit

Permalink
change types to a const to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
monotok committed Jan 16, 2023
1 parent d4d5c80 commit 47fc89f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions server/libs/infra/src/db/config/database.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { PostgresConnectionOptions } from 'typeorm/driver/postgres/PostgresConnectionOptions';
import { DataSource } from 'typeorm';

let additionalSSLDatabaseConfig;
let baseDatabaseConfig: PostgresConnectionOptions = {
const baseDatabaseConfig: PostgresConnectionOptions = {
type: 'postgres',
entities: [__dirname + '/../**/*.entity.{js,ts}'],
synchronize: false,
Expand All @@ -11,7 +10,7 @@ let baseDatabaseConfig: PostgresConnectionOptions = {
connectTimeoutMS: 10000, // 10 seconds
};

let envBasedDatabaseConfig = {
const envBasedDatabaseConfig = {
host: process.env.DB_HOSTNAME || 'immich_postgres',
port: parseInt(process.env.DB_PORT || '5432'),
username: process.env.DB_USERNAME,
Expand All @@ -20,7 +19,7 @@ let envBasedDatabaseConfig = {
};

const url = process.env.DB_URL;
additionalSSLDatabaseConfig = url ? { url } : envBasedDatabaseConfig;
const additionalSSLDatabaseConfig = url ? { url } : envBasedDatabaseConfig;

export const databaseConfig: PostgresConnectionOptions = { ...baseDatabaseConfig, ...additionalSSLDatabaseConfig };

Expand Down

0 comments on commit 47fc89f

Please sign in to comment.