Keeping database connection open, token is now pk.
This commit is contained in:
parent
916df48627
commit
92da7fb1e8
9
index.js
9
index.js
|
@ -38,16 +38,9 @@ if (fs.existsSync('./config.ini')) {
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const validUntil = now.getTime() + (30 * 24 * 60 * 60 * 1000);
|
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.run(from.split("@")[0], validUntil);
|
||||||
insertStmt.finalize();
|
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 {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user