mirror of
https://github.com/mohamadihsan/topuponline.git
synced 2026-12-06 20:16:28 +00:00
3902a74d6f
Keep recovered Load Balance writes and card audit atomic, and isolate Payment Recon tests.
19 lines
561 B
JavaScript
19 lines
561 B
JavaScript
const knex = require("knex");
|
|
const { observePool } = require("./pool-metrics");
|
|
const { withTransactionTimeZone } = require("../transaction-time");
|
|
require("dotenv").config();
|
|
|
|
const knexfile = require("../../knexfile");
|
|
|
|
const env = process.env.NODE_ENV || "production";
|
|
|
|
// if running unit testing, please change the configOptions to knexfile["testing"]
|
|
|
|
const configOptions = knexfile[env];
|
|
// const configOptions = knexfile["testing"];
|
|
|
|
|
|
const db = knex(withTransactionTimeZone(configOptions));
|
|
observePool('primary', db.client.pool);
|
|
module.exports = db;
|