Closed XhmikosR closed 8 years ago
After debugging this, the cause is I'm getting ETIMEDOUT
for some plugins. So, we need to handle this case and retry maybe.
grunt-plugins.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/grunt-plugins.js b/grunt-plugins.js
index c622a4c..7190196 100644
--- a/grunt-plugins.js
+++ b/grunt-plugins.js
@@ -108,11 +108,13 @@ function condensePlugin(plugin) {
function getPlugin(item, callback) {
var name = item.key[1];
var url = 'https://skimdb.npmjs.com/registry/' + name;
- request({url: url, json: true}, function handlePlugin(error, response, body) {
+ request({url: url, json: true, timeout: 30000}, function handlePlugin(error, response, body) {
+ //console.log('>>> name: ' + name + ', error: ' + error);
+ //console.log('>>> name: ' + name + ', error: ' + error + ', response.statusCode: ' + response.statusCode);
if (!error && response.statusCode === 200) {
callback(null, condensePlugin(body));
} else {
- console.log('Failed to get data for:', name);
+ console.log('Failed to get data for:', name + ' with error.code: ' + error.code);
callback(null, null);
}
});
And the output https://gist.github.com/XhmikosR/0f8ccce52b6bddd952b075468039f576
Why close this? It's still a valid issue.
@XhmikosR hm I thought the lists generates fine ? looking at http://gruntjs.com/plugins
Well, it does generate but many plugins should be missing due to this error.
/CC @vladikoff