summaryrefslogtreecommitdiffstats
path: root/models/cards.js
diff options
context:
space:
mode:
authorSam X. Chen <sam.xi.chen@gmail.com>2019-07-11 10:47:08 -0400
committerSam X. Chen <sam.xi.chen@gmail.com>2019-07-11 10:47:08 -0400
commitf2a0ae0a2c115a1cfdc3c6153ca80fd03df12ba7 (patch)
treeeffc415f39dd6a1d72c38c668fcba0cb9e0e4147 /models/cards.js
parent5ca09cdf096e02cfd8e6ecd61fc4cbb651703558 (diff)
parent46970ae424d33c3caec25acf2861407555713a30 (diff)
downloadwekan-f2a0ae0a2c115a1cfdc3c6153ca80fd03df12ba7.tar.gz
wekan-f2a0ae0a2c115a1cfdc3c6153ca80fd03df12ba7.tar.bz2
wekan-f2a0ae0a2c115a1cfdc3c6153ca80fd03df12ba7.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'models/cards.js')
-rw-r--r--models/cards.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/models/cards.js b/models/cards.js
index 115bed7c..d92d003c 100644
--- a/models/cards.js
+++ b/models/cards.js
@@ -1582,12 +1582,13 @@ const findDueCards = days => {
};
const addCronJob = _.debounce(
Meteor.bindEnvironment(function findDueCardsDebounced() {
- const notifydays = parseInt(process.env.NOTIFY_DUE_DAYS, 10) || 2; // default as 2 days b4 and after
+ const notifydays =
+ parseInt(process.env.NOTIFY_DUE_DAYS_BEFORE_AND_AFTER, 10) || 2; // default as 2 days before and after
if (!(notifydays > 0 && notifydays < 15)) {
// notifying due is disabled
return;
}
- const notifyitvl = process.env.NOTIFY_DUE_ITVL; //passed in the itvl has to be a number standing for the hour of current time
+ const notifyitvl = process.env.NOTIFY_DUE_AT_HOUR_OF_DAY; //passed in the itvl has to be a number standing for the hour of current time
const defaultitvl = 8; // default every morning at 8am, if the passed env variable has parsing error use default
const itvl = parseInt(notifyitvl, 10) || defaultitvl;
const scheduler = (job => () => {
@@ -1619,9 +1620,9 @@ if (Meteor.isServer) {
// With a huge database, this result in a very slow app and high CPU on the mongodb side.
// To correct it, add Index to parentId:
Cards._collection._ensureIndex({ parentId: 1 });
- /*let notifydays = parseInt(process.env.NOTIFY_DUE_DAYS) || 2; // default as 2 days b4 and after
- let notifyitvl = parseInt(process.env.NOTIFY_DUE_ITVL) || 3600 * 24 * 1e3; // default interval as one day
- Meteor.call("findDueCards",notifydays,notifyitvl);*/
+ // let notifydays = parseInt(process.env.NOTIFY_DUE_DAYS_BEFORE_AND_AFTER) || 2; // default as 2 days b4 and after
+ // let notifyitvl = parseInt(process.env.NOTIFY_DUE_AT_HOUR_OF_DAY) || 3600 * 24 * 1e3; // default interval as one day
+ // Meteor.call("findDueCards",notifydays,notifyitvl);
Meteor.defer(() => {
addCronJob();
});