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/12/06 17:46:54 UTC
[GitHub] csantanapr closed pull request #188: update Node.js version to
8.14.0
csantanapr closed pull request #188: update Node.js version to 8.14.0
URL: https://github.com/apache/incubator-openwhisk-package-cloudant/pull/188
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/Dockerfile b/Dockerfile
index e5e8a21..9a4c6d7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:8.12.0
+FROM node:8.14.0
# only package.json
ADD package.json /
diff --git a/provider/lib/utils.js b/provider/lib/utils.js
index 9a77999..c863d74 100644
--- a/provider/lib/utils.js
+++ b/provider/lib/utils.js
@@ -242,22 +242,29 @@ module.exports = function(logger, triggerDB, redisClient) {
json: form
}, function(error, response) {
try {
- logger.info(method, triggerData.id, 'http post request, STATUS:', response ? response.statusCode : response);
- if (error || response.statusCode >= 400) {
+ var statusCode;
+ if (!error) {
+ statusCode = response.statusCode;
+ }
+ else if (error.statusCode) {
+ statusCode = error.statusCode;
+ }
+ logger.info(method, triggerData.id, 'http post request, STATUS:', statusCode);
+ if (error || statusCode >= 400) {
// only manage trigger fires if they are not infinite
if (triggerData.maxTriggers !== -1) {
triggerData.triggersLeft++;
}
- logger.error(method, 'there was an error invoking', triggerData.id, response ? response.statusCode : error);
- if (!error && shouldDisableTrigger(response.statusCode)) {
+ logger.error(method, 'there was an error invoking', triggerData.id, statusCode || error);
+ if (!error && shouldDisableTrigger(statusCode)) {
//disable trigger
- var message = 'Automatically disabled after receiving a ' + response.statusCode + ' status code when firing the trigger';
- disableTrigger(triggerData.id, response.statusCode, message);
- reject('Disabled trigger ' + triggerData.id + ' due to status code: ' + response.statusCode);
+ var message = 'Automatically disabled after receiving a ' + statusCode + ' status code when firing the trigger';
+ disableTrigger(triggerData.id, statusCode, message);
+ reject('Disabled trigger ' + triggerData.id + ' due to status code: ' + statusCode);
}
else {
if (retryCount < retryAttempts ) {
- var timeout = response && response.statusCode === 429 && retryCount === 0 ? 60000 : 1000 * Math.pow(retryCount + 1, 2);
+ var timeout = statusCode === 429 && retryCount === 0 ? 60000 : 1000 * Math.pow(retryCount + 1, 2);
logger.info(method, 'attempting to fire trigger again', triggerData.id, 'Retry Count:', (retryCount + 1));
setTimeout(function () {
postTrigger(triggerData, form, uri, (retryCount + 1))
----------------------------------------------------------------
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