use subdomains.update to short-circuit dns propagation check

if the entry is already uptodate, then we can bypass the wait
This commit is contained in:
Girish Ramakrishnan
2016-09-05 00:02:19 -07:00
parent 59e1e55666
commit ec63c1c96e

View File

@@ -253,7 +253,7 @@ function registerSubdomain(app, callback) {
async.retry({ times: 200, interval: 5000 }, function (retryCallback) {
debugApp(app, 'Registering subdomain location [%s]', app.location);
subdomains.add(app.location, 'A', [ ip ], function (error, changeId) {
subdomains.update(app.location, 'A', [ ip ], function (error, changeId) {
if (error && (error.reason === SubdomainError.STILL_BUSY || error.reason === SubdomainError.EXTERNAL_ERROR)) return retryCallback(error); // try again
retryCallback(null, error || changeId);