From 92da7fb1e8405615329cb8843454817648e16a4a Mon Sep 17 00:00:00 2001 From: stephen Date: Thu, 16 Nov 2023 00:45:19 -0500 Subject: [PATCH] Keeping database connection open, token is now pk. --- index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 22f9065..a56e9fe 100644 --- a/index.js +++ b/index.js @@ -38,17 +38,10 @@ if (fs.existsSync('./config.ini')) { const now = new Date(); const validUntil = now.getTime() + (30 * 24 * 60 * 60 * 1000); - const insertStmt = db.prepare('INSERT INTO users (pnum, token) VALUES (?, ?)'); + const insertStmt = db.prepare('INSERT INTO users (pnum, pk) VALUES (?, ?)'); insertStmt.run(from.split("@")[0], validUntil); insertStmt.finalize(); - console.log('Data inserted successfully'); - // db.close((err) => { - // if (err) { - // return console.error('Error closing the database:', err.message); - // } - // console.log('Database connection closed.'); - // }); - debug(); + debug(); } else { async function main() {