diff --git a/core/api/src/servers/exporter.ts b/core/api/src/servers/exporter.ts index 36936dba14..9b67d7a179 100644 --- a/core/api/src/servers/exporter.ts +++ b/core/api/src/servers/exporter.ts @@ -211,7 +211,10 @@ const main = async () => { activateLndHealthCheck() } -setupMongoConnection() +setupMongoConnection({ + syncIndexes: false, + options: { readPreference: "secondaryPreferred" }, +}) .then(() => main()) .catch((err) => logger.error(err)) diff --git a/core/api/src/services/ledger/index.ts b/core/api/src/services/ledger/index.ts index 9c14c8f409..e6f71b316e 100644 --- a/core/api/src/services/ledger/index.ts +++ b/core/api/src/services/ledger/index.ts @@ -312,12 +312,9 @@ export const LedgerService = (): ILedgerService => { ): Promise => { const liabilitiesWalletId = toLiabilitiesWalletId(walletId) try { - const { balance } = await MainBook.balance( - { - account: liabilitiesWalletId, - }, - { readPreference: "primaryPreferred" }, - ) + const { balance } = await MainBook.balance({ + account: liabilitiesWalletId, + }) if (balance < 0) { const dealerUsdWalletId = await caching.getDealerUsdWalletId() const dealerBtcWalletId = await caching.getDealerBtcWalletId() @@ -343,12 +340,9 @@ export const LedgerService = (): ILedgerService => { ): Promise | LedgerError> => { const liabilitiesWalletId = toLiabilitiesWalletId(walletDescriptor.id) try { - const { balance } = await MainBook.balance( - { - account: liabilitiesWalletId, - }, - { readPreference: "primaryPreferred" }, - ) + const { balance } = await MainBook.balance({ + account: liabilitiesWalletId, + }) if (balance < 0) { const dealerWalletIds = Object.values(await caching.getDealerWalletIds())