API-36: 🚑 Fixing critical issue with the amount of sql connections (!15)
Jenkins Production Deployment
Jenkins Production Deployment
Co-authored-by: Patrick Mueller <patrick@mueller-patrick.tech> Reviewed-on: #15 Co-authored-by: Patrick Müller <patrick@plutodev.de> Co-committed-by: Patrick Müller <patrick@plutodev.de>
This commit was merged in pull request #15.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import * as dotenv from 'dotenv';
|
||||
|
||||
const mariadb = require('mariadb');
|
||||
|
||||
dotenv.config();
|
||||
|
||||
export namespace BetterzonDB {
|
||||
const pool = mariadb.createPool({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASSWORD,
|
||||
database: process.env.BETTERZON_DATABASE,
|
||||
connectionLimit: 5
|
||||
});
|
||||
|
||||
export function getConnection() {
|
||||
return pool;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user