Fix usage of safe()
This commit is contained in:
+3
-3
@@ -263,14 +263,14 @@ async function registerLocations(locations, options, progressCallback) {
|
||||
await registerLocation(location, options, 'A', ipv4);
|
||||
} else {
|
||||
const [aError, aValues] = await safe(getDnsRecords(location.subdomain, location.domain, 'A'));
|
||||
if (!aError && aValues.length) await safe(removeDnsRecords(location.subdomain, location.domain, 'A', aValues), { log });
|
||||
if (!aError && aValues.length) await safe(removeDnsRecords(location.subdomain, location.domain, 'A', aValues), { debug: log });
|
||||
}
|
||||
|
||||
if (ipv6) {
|
||||
await registerLocation(location, options, 'AAAA', ipv6);
|
||||
} else {
|
||||
const [aaaaError, aaaaValues] = await safe(getDnsRecords(location.subdomain, location.domain, 'AAAA'));
|
||||
if (!aaaaError && aaaaValues.length) await safe(removeDnsRecords(location.subdomain, location.domain, 'AAAA', aaaaValues), { log });
|
||||
if (!aaaaError && aaaaValues.length) await safe(removeDnsRecords(location.subdomain, location.domain, 'AAAA', aaaaValues), { debug: log });
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -364,7 +364,7 @@ async function startSyncDnsRecords(options) {
|
||||
assert.strictEqual(typeof options, 'object');
|
||||
|
||||
const taskId = await tasks.add(tasks.TASK_SYNC_DNS_RECORDS, [ options ]);
|
||||
safe(tasks.startTask(taskId, {}), { log }); // background
|
||||
safe(tasks.startTask(taskId, {}), { debug: log }); // background
|
||||
return taskId;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user