This is an automated email from the ASF dual-hosted git repository.

dubeejw pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-alarms.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a436a3  fix for health monitor stopDate (#142)
5a436a3 is described below

commit 5a436a3c31e863e18efb8c1609683bd4f17591af
Author: Jason Peterson <[email protected]>
AuthorDate: Thu Mar 22 13:27:15 2018 -0400

    fix for health monitor stopDate (#142)
---
 provider/lib/health.js | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/provider/lib/health.js b/provider/lib/health.js
index 5255a5a..19874c2 100644
--- a/provider/lib/health.js
+++ b/provider/lib/health.js
@@ -115,18 +115,19 @@ module.exports = function(logger, utils) {
             monitor: utils.host
         };
 
-        var currentDate = Date.now();
+        var minuteInterval = 1000 * 60;
+        var startDate = Date.now() + minuteInterval;
         if (alarmType === 'interval') {
             newTrigger.minutes = 1;
-            newTrigger.startDate = currentDate + (1000 * 60);
-            newTrigger.stopDate = currentDate + (1000 * 70);
+            newTrigger.startDate = startDate;
+            newTrigger.stopDate = startDate + minuteInterval;
         }
         else if (alarmType === 'date') {
-            newTrigger.date = currentDate + (1000 * 60);
+            newTrigger.date = startDate;
         }
         else {
             newTrigger.cron = '* * * * *';
-            newTrigger.stopDate = currentDate + (1000 * 70);
+            newTrigger.stopDate = startDate + minuteInterval;
         }
 
         return newTrigger;

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to