fix
This commit is contained in:
parent
7e2f06d0d5
commit
5e627d099c
|
@ -5,19 +5,16 @@
|
||||||
|
|
||||||
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';
|
||||||
|
|
||||||
const config = loadConfig();
|
const config = loadConfig();
|
||||||
|
|
||||||
// createPostgresDataSource handels primaries and replicas automatically.
|
async function connectToPostgres() {
|
||||||
// usually, it only opens connections first use, so we force it using
|
|
||||||
// .initialize()
|
|
||||||
async function connectToPostgres(){
|
|
||||||
const source = createPostgresDataSource(config);
|
const source = createPostgresDataSource(config);
|
||||||
await source.initialize();
|
await source.initialize();
|
||||||
await source.destroy();
|
await source.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Connect to all redis servers
|
|
||||||
async function connectToRedis(redisOptions) {
|
async function connectToRedis(redisOptions) {
|
||||||
return await new Promise(async (resolve, reject) => {
|
return await new Promise(async (resolve, reject) => {
|
||||||
const redis = new Redis({
|
const redis = new Redis({
|
||||||
|
|
Loading…
Reference in New Issue