You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/03/10 13:54:35 UTC

[GitHub] csantanapr closed pull request #138: cleanup unnecessary check

csantanapr closed pull request #138: cleanup unnecessary check
URL: https://github.com/apache/incubator-openwhisk-package-alarms/pull/138
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/provider/lib/sanitizer.js b/provider/lib/sanitizer.js
index cb173d2..3553010 100644
--- a/provider/lib/sanitizer.js
+++ b/provider/lib/sanitizer.js
@@ -149,24 +149,22 @@ module.exports = function(logger, triggerDB, uriHost) {
         return new Promise(function(resolve, reject) {
             triggerDB.get(triggerID, function (err, existing) {
                 if (!err) {
-                    if (!existing.status || existing.status.active === true) {
-                        var updatedTrigger = existing;
-                        var status = {
-                            'active': false,
-                            'dateChanged': Date.now(),
-                            'reason': {'kind': 'AUTO', 'statusCode': undefined, 'message': `Marked for deletion`}
-                        };
-                        updatedTrigger.status = status;
-
-                        triggerDB.insert(updatedTrigger, triggerID, function (err) {
-                            if (err) {
-                                reject(err);
-                            }
-                            else {
-                                resolve(triggerID);
-                            }
-                        });
-                    }
+                    var updatedTrigger = existing;
+                    var status = {
+                        'active': false,
+                        'dateChanged': Date.now(),
+                        'reason': {'kind': 'AUTO', 'statusCode': undefined, 'message': `Marked for deletion`}
+                    };
+                    updatedTrigger.status = status;
+
+                    triggerDB.insert(updatedTrigger, triggerID, function (err) {
+                        if (err) {
+                            reject(err);
+                        }
+                        else {
+                            resolve(triggerID);
+                        }
+                    });
                 }
                 else {
                     reject(err);


 

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


With regards,
Apache Git Services