Skip to content

Commit

Permalink
time execution of database queries
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecM33 committed Nov 24, 2024
1 parent b2fdf8c commit 6802780
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions database/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ module.exports = {

function query (queryParams) {
return new Promise((resolve, reject) => {
console.time("query");
pool.connect().then((client) => client.query(queryParams, (err, res) => {
if (err) {
client.release();
Expand All @@ -142,5 +143,6 @@ function query (queryParams) {
console.error(e);
reject(new Error('The bot could not complete your request due to connection issues.'));
});
console.timeEnd("query");
});
}

0 comments on commit 6802780

Please sign in to comment.