diff options
author | Lauri Ojansivu <x@xet7.org> | 2019-07-10 13:45:37 -0400 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2019-07-10 13:45:37 -0400 |
commit | 5084cddf37ba16ce0855f8575c39f5e62d1b7f67 (patch) | |
tree | 0eaace648c97c2425a6121b0c0c332c1abeea065 /models | |
parent | a3201f4d289ea50e9679e35d0c4644f0a6345052 (diff) | |
download | wekan-5084cddf37ba16ce0855f8575c39f5e62d1b7f67.tar.gz wekan-5084cddf37ba16ce0855f8575c39f5e62d1b7f67.tar.bz2 wekan-5084cddf37ba16ce0855f8575c39f5e62d1b7f67.zip |
Notify Due Days: Add settings to Snap/Docker/Source.
Rename env variables to NOTIFY_DUE_DAYS_BEFORE_AND_AFTER and NOTIFY_DUE_AT_HOUR_OF_DAY.
Thanks to xet7 !
Diffstat (limited to 'models')
-rw-r--r-- | models/cards.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/cards.js b/models/cards.js index 115bed7c..b354511d 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,8 +1620,8 @@ 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 + /*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(); |