Skip to content

Commit

Permalink
Merge pull request #246 from adrianmarinica/bugfix-github-rate-limit
Browse files Browse the repository at this point in the history
Fix issue with Intercom pod not being updated / installed when GitHub response was not 200 OK
  • Loading branch information
ronocod authored Feb 12, 2018
2 parents 9ba0070 + 39856e0 commit 49d684b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions intercom-plugin/scripts/checkForUpdate.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ module.exports = function(context) {
updateInfo.lastCheckDate = Date.now();

if (releaseData != null) {
updateInfo.releaseDate = Date.parse(releaseData['published_at']);
updateIntercomIfNeeded(context, updateInfo, function() {
deferral.resolve();
});
updateInfo.releaseDate = Date.parse(releaseData['published_at']);
} else {
writeUpdateInfo(context, updateInfo, function() {
deferral.resolve();
});
// last release date is unavailable, set it to today so that the pod is installed
updateInfo.releaseDate = Date.now();
}

updateIntercomIfNeeded(context, updateInfo, function() {
deferral.resolve();
});
});
} else {
deferral.resolve();
Expand Down

0 comments on commit 49d684b

Please sign in to comment.