feat: added read replica option in config and extended knex to choose

This commit is contained in:
=
2024-06-25 22:49:28 +05:30
parent a016d0d33f
commit 259c01c110
7 changed files with 877 additions and 21 deletions
+5 -1
View File
@@ -15,7 +15,11 @@ const run = async () => {
const appCfg = initEnvConfig(logger);
const db = initDbConnection({
dbConnectionUri: appCfg.DB_CONNECTION_URI,
dbRootCert: appCfg.DB_ROOT_CERT
dbRootCert: appCfg.DB_ROOT_CERT,
readReplicas: appCfg.DB_READ_REPLICAS?.map((el) => ({
dbRootCert: el.DB_ROOT_CERT,
dbConnectionUri: el.DB_CONNECTION_URI
}))
});
const smtp = smtpServiceFactory(formatSmtpConfig());