style95 commented on a change in pull request #198: Make cron triggers fire 
with random delay with parameter `strict`
URL: 
https://github.com/apache/openwhisk-package-alarms/pull/198#discussion_r381165176
 
 

 ##########
 File path: provider/lib/cronAlarm.js
 ##########
 @@ -85,4 +86,41 @@ module.exports = function(logger, newTrigger) {
         }
     };
 
+    // Convert string to integer in [0, delayLimit)
+    function hashName(name) {
+        var hash = 0;
+
+        for (var i = 0; i < name.length; i++) {
+            var char = name.charCodeAt(i);
+            hash = ((hash << 5) - hash) + char;
+        }
+        hash %= delayLimit + 1;
+        hash = Math.abs(hash);
+
+        return hash.toString(10);
+    }
+
+    function distributeCron(trigger) {
+        var method = "distributeCronAlarm"
 
 Review comment:
   A semicolon is missing and Travis complains about itit.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to