fix startup crash when calling check_connect.js
This commit is contained in:
parent
e4c29e7aa0
commit
a1bff0e0fe
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
import Redis from 'ioredis';
|
import Redis from 'ioredis';
|
||||||
import { loadConfig } from '../built/config.js';
|
import { loadConfig } from '../built/config.js';
|
||||||
import { createPostgresDataSource } from '../built/postgres.js';
|
import { createPostgresDataSource } from '../built/postgres.js';
|
||||||
|
import Logger from '../src/logger.js';
|
||||||
|
|
||||||
const config = loadConfig();
|
const config = loadConfig();
|
||||||
|
|
||||||
|
|
@ -13,7 +14,7 @@ const config = loadConfig();
|
||||||
// usually, it only opens connections first use, so we force it using
|
// usually, it only opens connections first use, so we force it using
|
||||||
// .initialize()
|
// .initialize()
|
||||||
async function connectToPostgres() {
|
async function connectToPostgres() {
|
||||||
const source = createPostgresDataSource(config);
|
const source = createPostgresDataSource(config, new Logger('check-connect'));
|
||||||
await source.initialize();
|
await source.initialize();
|
||||||
await source.destroy();
|
await source.destroy();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue