Use for..of instead of forEach for clarity

This commit is contained in:
Girish Ramakrishnan
2021-10-06 13:01:12 -07:00
parent 93636a7f3a
commit 4a9d074b50

View File

@@ -240,10 +240,10 @@ async function setFallbackCertificate(domain, fallback) {
async function restoreFallbackCertificates() {
const result = await domains.list();
result.forEach(function (domain) {
for (const domain of result) {
if (!safe.fs.writeFileSync(path.join(paths.NGINX_CERT_DIR, `${domain.domain}.host.cert`), domain.fallbackCertificate.cert)) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
if (!safe.fs.writeFileSync(path.join(paths.NGINX_CERT_DIR, `${domain.domain}.host.key`), domain.fallbackCertificate.key)) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
});
}
}
function getFallbackCertificatePathSync(domain) {