plutoapi-v2/src/models/twitch-highlight-marker/HighlightMarker.db.ts
Patrick Müller b4d5bdd0b6
All checks were successful
Jenkins Production Deployment
API-36: 🚑 Fixing critical issue with the amount of sql connections (!15)
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>
2022-01-08 15:42:09 +00:00

20 lines
431 B
TypeScript

import * as dotenv from 'dotenv';
const mariadb = require('mariadb');
dotenv.config();
export namespace HighlightMarkerDB {
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;
}
}