more debugs

This commit is contained in:
Girish Ramakrishnan
2019-04-08 13:54:53 -07:00
parent 9fbe209c04
commit f0a5cc6116
+6 -2
View File
@@ -45,6 +45,8 @@ function getInternal(dnsConfig, zoneName, name, type, callback) {
var nextPage = null, matchingRecords = [];
debug(`getInternal: getting dns records of ${zoneName} with ${name} and type ${type}`);
async.doWhilst(function (iteratorDone) {
var url = nextPage ? nextPage : DIGITALOCEAN_ENDPOINT + '/v2/domains/' + zoneName + '/records';
@@ -63,12 +65,14 @@ function getInternal(dnsConfig, zoneName, name, type, callback) {
nextPage = (result.body.links && result.body.links.pages) ? result.body.links.pages.next : null;
debug(`getInternal: next page - ${nextPage}`);
iteratorDone();
});
}, function () { return !!nextPage; }, function (error) {
if (error) return callback(error);
debug('getInternal:', error, matchingRecords);
debug('getInternal: %j', matchingRecords);
if (error) return callback(error);
return callback(null, matchingRecords);
});