Skip to content

Commit 47c20f0

Browse files
committed
chore: clean up dead code and unused import
- Remove unused jwt import from routes/auth.js - Remove dead function getPteroUserByEmail from services/pyrodactyl.js - Add connection timeout config to db pool
1 parent ac3a67b commit 47c20f0

3 files changed

Lines changed: 2 additions & 9 deletions

File tree

config/db.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const pool = mariadb.createPool({
1313
password: process.env.DB_PASSWORD,
1414
database: process.env.DB_NAME,
1515
connectionLimit: 10,
16+
connectTimeout: 5000,
1617
acquireTimeout: 10000,
18+
idleTimeout: 30000,
1719
insertIdAsNumber: true,
1820
});
1921

routes/auth.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Router } from 'express';
2-
import jwt from 'jsonwebtoken';
32
import argon2 from 'argon2';
43
import { query } from '../config/db.js';
54
import { generateToken, authenticateToken } from '../middleware/auth.js';

services/pyrodactyl.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ export async function createPteroUser({ email, username, firstName, lastName, pa
6262
return data.attributes;
6363
}
6464

65-
async function getPteroUserByEmail(email) {
66-
const data = await pteroFetch(`/users?filter[email]=${encodeURIComponent(email)}`);
67-
if (data.data.length > 0) {
68-
return data.data[0].attributes;
69-
}
70-
return null;
71-
}
72-
7365
export async function getPteroUserById(id) {
7466
const data = await pteroFetch(`/users/${id}`);
7567
return data.attributes;

0 commit comments

Comments
 (0)