daveappserver 0.6.36 → 0.6.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/appserver.js +17 -4
- package/package.json +1 -1
package/appserver.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var myVersion = "0.6.
|
|
1
|
+
var myVersion = "0.6.38", myProductName = "daveAppServer";
|
|
2
2
|
|
|
3
3
|
exports.start = startup;
|
|
4
4
|
exports.notifySocketSubscribers = notifySocketSubscribers;
|
|
@@ -61,7 +61,7 @@ var config = {
|
|
|
61
61
|
operationToConfirm: "add your email address to your FeedLand user profile",
|
|
62
62
|
mailSender: "dave@scripting.com",
|
|
63
63
|
dataFolder: "data/",
|
|
64
|
-
confirmationExpiresAfter: 60 * 60, //emails expire after
|
|
64
|
+
confirmationExpiresAfter: 60 * 60 * 24, //emails expire after 24 hours
|
|
65
65
|
|
|
66
66
|
flSecureWebsocket: false, //2/8/23 by DW
|
|
67
67
|
|
|
@@ -1077,7 +1077,7 @@ function cleanFileStats (stats) { //4/19/21 by DW
|
|
|
1077
1077
|
}
|
|
1078
1078
|
function deletePendingConfirmation (item, callback) { //8/14/23 by DW
|
|
1079
1079
|
if (config.flUseDatabaseForConfirmations) {
|
|
1080
|
-
const sqltext = "
|
|
1080
|
+
const sqltext = "delete from pendingConfirmations where magicString = " + davesql.encode (item.magicString) + ";"; //8/15/23 by DW
|
|
1081
1081
|
davesql.runSqltext (sqltext, function (err, result) {
|
|
1082
1082
|
if (err) {
|
|
1083
1083
|
if (callback !== undefined) {
|
|
@@ -1097,6 +1097,19 @@ function cleanFileStats (stats) { //4/19/21 by DW
|
|
|
1097
1097
|
}
|
|
1098
1098
|
function checkPendingConfirmations (callback) { //8/14/23 by DW
|
|
1099
1099
|
if (config.flUseDatabaseForConfirmations) {
|
|
1100
|
+
const sqltext = "delete from pendingConfirmations where whenCreated < now() - interval " + config.confirmationExpiresAfter + " minute;";
|
|
1101
|
+
davesql.runSqltext (sqltext, function (err, result) {
|
|
1102
|
+
if (err) {
|
|
1103
|
+
if (callback !== undefined) {
|
|
1104
|
+
callback (err);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
else {
|
|
1108
|
+
if (callback !== undefined) {
|
|
1109
|
+
callback (undefined);
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
});
|
|
1100
1113
|
}
|
|
1101
1114
|
else {
|
|
1102
1115
|
var flChanged = false;
|
|
@@ -1748,8 +1761,8 @@ function startup (options, callback) {
|
|
|
1748
1761
|
}
|
|
1749
1762
|
if (now.getMinutes () == 0) {
|
|
1750
1763
|
console.log ("\n" + now.toLocaleTimeString () + ": " + config.productName + " v" + config.version + " running on port " + config.port + ".\n");
|
|
1764
|
+
checkPendingConfirmations (); //12/7/22 by DW
|
|
1751
1765
|
}
|
|
1752
|
-
checkPendingConfirmations (); //12/7/22 by DW
|
|
1753
1766
|
}
|
|
1754
1767
|
function everySecond () {
|
|
1755
1768
|
if (flStatsChanged) {
|