refreshDNS must always overwrite dns entries

dnsRecordId is mostly obsolete
This commit is contained in:
Girish Ramakrishnan
2017-02-02 10:32:22 -08:00
parent bd0be2affc
commit 45a61e9541

View File

@@ -939,15 +939,7 @@ function refreshDNS(callback) {
if (error) return callback(error);
async.each(result, function (app, callback) {
// get the current record before updating it
subdomains.get(app.location, 'A', function (error, values) {
if (error) return callback(error);
// refuse to update any existing DNS record for custom domains that we did not create
if (values.length !== 0 && !app.dnsRecordId) return callback(null, new Error('DNS Record already exists'));
subdomains.upsert(app.location, 'A', [ ip ], callback);
});
subdomains.upsert(app.location, 'A', [ ip ], callback);
}, function (error) {
if (error) return callback(error);