diff --git a/src/dns/digitalocean.js b/src/dns/digitalocean.js index f7d6643b3..54a8d9280 100644 --- a/src/dns/digitalocean.js +++ b/src/dns/digitalocean.js @@ -143,7 +143,13 @@ function upsert(domainObject, location, type, values, callback) { return iteratorCallback(null); }); } - }, callback); + }, function (error) { + if (error) return callback(error); + + debug('upsert: completed with recordIds:%j', recordIds); + + callback(); + }); }); } diff --git a/src/mail.js b/src/mail.js index b1f575930..d2ff27671 100644 --- a/src/mail.js +++ b/src/mail.js @@ -811,6 +811,8 @@ function upsertDnsRecords(domain, mailFqdn, callback) { assert.strictEqual(typeof mailFqdn, 'string'); assert.strictEqual(typeof callback, 'function'); + debug(`upsertDnsRecords: updating mail dns records of domain ${domain} and mail fqdn ${mailFqdn}`); + maildb.get(domain, function (error, result) { if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new MailError(MailError.NOT_FOUND)); if (error) return callback(new MailError(MailError.INTERNAL_ERROR, error)); @@ -833,8 +835,6 @@ function upsertDnsRecords(domain, mailFqdn, callback) { records.push({ subdomain: '', domain: domain, type: 'MX', values: [ '10 ' + mailFqdn + '.' ] }); } - debug('upsertDnsRecords: %j', records); - txtRecordsWithSpf(domain, mailFqdn, function (error, txtRecords) { if (error) return callback(error);