rename slave to replica in db config

This commit is contained in:
Hongbo Wu
2024-06-26 11:33:38 +08:00
parent 3632ba9071
commit 57e0002cae
2 changed files with 17 additions and 17 deletions

View File

@ -37,11 +37,11 @@ if (env.pg.replication) {
},
slaves: [
{
host: env.pg.slave.host,
port: env.pg.slave.port,
username: env.pg.slave.userName,
password: env.pg.slave.password,
database: env.pg.slave.dbName,
host: env.pg.replica.host,
port: env.pg.replica.port,
username: env.pg.replica.userName,
password: env.pg.replica.password,
database: env.pg.replica.dbName,
},
],
},

View File

@ -20,7 +20,7 @@ export interface BackendEnv {
max: number
}
replication: boolean
slave: {
replica: {
host: string
port: number
userName: string
@ -188,11 +188,11 @@ const nullableEnvVars = [
'NOTION_AUTH_URL',
'SCORE_API_URL',
'PG_REPLICATION',
'PG_SLAVE_HOST',
'PG_SLAVE_PORT',
'PG_SLAVE_USER',
'PG_SLAVE_PASSWORD',
'PG_SLAVE_DB',
'PG_REPLICA_HOST',
'PG_REPLICA_PORT',
'PG_REPLICA_USER',
'PG_REPLICA_PASSWORD',
'PG_REPLICA_DB',
] // Allow some vars to be null/empty
const envParser =
@ -233,12 +233,12 @@ export function getEnv(): BackendEnv {
max: parseInt(parse('PG_POOL_MAX'), 10),
},
replication: parse('PG_REPLICATION') === 'true',
slave: {
host: parse('PG_SLAVE_HOST'),
port: parseInt(parse('PG_SLAVE_PORT'), 10),
userName: parse('PG_SLAVE_USER'),
password: parse('PG_SLAVE_PASSWORD'),
dbName: parse('PG_SLAVE_DB'),
replica: {
host: parse('PG_REPLICA_HOST'),
port: parseInt(parse('PG_REPLICA_PORT'), 10),
userName: parse('PG_REPLICA_USER'),
password: parse('PG_REPLICA_PASSWORD'),
dbName: parse('PG_REPLICA_DB'),
},
}
const server = {