From 6b21df5ce3bbee421dd1263cd833ce1343e8c214 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@keylocation.sg> Date: Sun, 22 Jan 2017 12:49:35 +0100 Subject: [PATCH] Debug rate limit after execution --- lib/api/github.js | 8 ++++++++ lib/index.js | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/api/github.js b/lib/api/github.js index 5b05466e35..08a7c31f61 100644 --- a/lib/api/github.js +++ b/lib/api/github.js @@ -5,6 +5,7 @@ const config = {}; module.exports = { initRepo, + getRateLimit, // Search findFilePaths, // Branch @@ -62,6 +63,13 @@ function initRepo(repoName) { } } +// Get rate limit +function getRateLimit() { + logger.info('getRateLimit'); + return ghGot('rate_limit') + .then(res => res.body); +} + // Search // Returns an array of file paths in current repo matching the fileName diff --git a/lib/index.js b/lib/index.js index fffc1d4451..cc68b6c427 100644 --- a/lib/index.js +++ b/lib/index.js @@ -79,8 +79,11 @@ function start() { } // Process all promises - p.then(() => { // eslint-disable-line promise/always-return + p + .then(github.getRateLimit) + .then((rateLimit) => { // eslint-disable-line promise/always-return logger.info('Renovate finished'); + logger.debug(JSON.stringify(rateLimit)); }) .catch((error) => { logger.error(`Unexpected error: ${error}`); -- GitLab