From 539176f4e43afd6cd90903885c47cbd9ab850345 Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 12 Nov 2024 06:28:59 +0700 Subject: [PATCH] Try --- src/util.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/util.js b/src/util.js index f2c8e9f..467f0ff 100644 --- a/src/util.js +++ b/src/util.js @@ -59,15 +59,19 @@ async function updateWildcardData() { } catch (error) { } - const domains = (process.env.SSL_WILDCARDS || '').split(',').map(x => x.split(':')[0]); - for (const [domain, d] of Object.entries(await virtualminExec.getDomainInfo(domains, true))) { - sslWildcardsMap[domain] = { - id: d['ID'] + '', - path: dirname(d['SSL key file'] + ''), - domain, + try { + const domains = (process.env.SSL_WILDCARDS || '').split(',').map(x => x.split(':')[0]); + for (const [domain, d] of Object.entries(await virtualminExec.getDomainInfo(domains, true))) { + sslWildcardsMap[domain] = { + id: d['ID'] + '', + path: dirname(d['SSL key file'] + ''), + domain, + } } + writeTo(cachepath, JSON.stringify(sslWildcardsMap)) + } catch (error) { + console.error("Cant get valid ssl domain", error) } - writeTo(cachepath, JSON.stringify(sslWildcardsMap)) } export const getLtsPhp = (/** @type {string} */ major) => {