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 2019/11/18 23:45:34 UTC

[GitHub] [openwhisk-package-kafka] dubee commented on a change in pull request #360: Update existing triggers on create instead of failing

dubee commented on a change in pull request #360: Update existing triggers on create instead of failing
URL: https://github.com/apache/openwhisk-package-kafka/pull/360#discussion_r347667862
 
 

 ##########
 File path: action/lib/Database.js
 ##########
 @@ -58,7 +58,16 @@ module.exports = function(dbURL, dbName) {
         return new Promise((resolve, reject) => {
             this.db.insert(params, (err, result) => {
                 if(err) {
-                    reject(err);
+                    if(err.statusCode && err.statusCode === 409) {
+                        this.getTrigger(params.triggerName)
+                        .then(() => this.disableTrigger(params.triggerName))
 
 Review comment:
   I don't understand why all this async stuff is going on when the entire action functionality is blocking anyway...

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services